You're replying to a comment left by George that was posted on March 28, 2010

Is it possible using htaccess to pass the variables, but strip them from the address bar/URL?

In other words, for a link such as:

http://XYZ.com/projects/project-01.php?tID=1&sID=1

to display as either:

http://XYZ.com/projects/project-01.php

or preferably:

http://XYZ.com/projects/project-01

but still pass through the variables? In this case the variables are passing through info to style the navigation text depending on where the user is in the site. Stripping the query disables this, so I need to pass the query, and then get rid of the ugliness.

You're replying to a comment left by Anre that was posted on February 21, 2010

how to redirect
http://domain.com/index.php?/artice to http://domain.com/index.php/artice. I mean how i remove question mark after index.php

thanks

You're replying to a comment left by Kyle that was posted on February 21, 2010

Try this out:

RewriteRule ^index.php\?(.*)$ index.php$1 [L]

You're replying to a comment left by Anre that was posted on February 21, 2010

doesnt work

You're replying to a comment left by Kyle that was posted on February 22, 2010

Without knowing what CMS this is, it would probably be easier to just drop index.php from the URL and send all requests to that. Try one of the following:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php?/$0 [PT,L,QSA]

You're replying to a comment left by Anre that was posted on February 22, 2010

Hello Kyle, Thanks for comment
I’m using joomla 1.5.x

You're replying to a comment left by Kyle that was posted on February 22, 2010

Please refer to the following:

http://cwhurl.com/sgj9

You're replying to a comment left by Nancy that was posted on April 09, 2010

I have a blogger account that tells me I can link my posts to go to my website, but when I put the name of my website in to link so the blog shows up, it tells me something is wrong.
Is this something that should be configured thru the htaccess file?

You're replying to a comment left by pietr that was posted on April 15, 2010

Good article!
as you’re offering help:
with a vanilla install of magento I run into:
the links of a first install show this:
http://my.site.org/default/customer/account/login/
but they require this:
http://my.site.org/index.php/default/customer/account/login/

if I change this with htaccess do I fix someting which is broken elsware?

You're replying to a comment left by Scott that was posted on April 21, 2010

HI!  By default, the shared hosting servers at Hostgator require that a visitor type in the .html extension to bring up any page other than the default.  How could I set that so that it would go to the .html file by default without having to type it in.  Thanks!

You're replying to a comment left by RaMp6 that was posted on April 28, 2010

404 doesn’t work any more :S
this is my .htaccess:

ErrorDocument 500 /error.php?id=500
ErrorDocument 404 /error.php?id=404
ErrorDocument 401 /error.php?id=401
ErrorDocument 403 /error.php?id=403


RewriteEngine on
RewriteRule ^tutorials/([0-9]+)/$ /tutorials.php?id=$1
RewriteRule ^tutorials/([0-9]+)$  /tutorials/$1/ [R=301,L]

RewriteRule ^downloads/([0-9]+)/$ /downloads.php?id=$1
RewriteRule ^downloads/([0-9]+)$  /downloads/$1/ [R=301,L]

RewriteRule ^nieuws/([0-9]+)/$ /nieuws.php?id=$1
RewriteRule ^nieuws/([0-9]+)$  /nieuws/$1/ [R=301,L]


RewriteRule ^(.*)/$ /$1.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.freehacks.nl/$1/ [R=301,L]

You're replying to a comment left by RaMp6 that was posted on April 28, 2010

now 404 works but my forum doesn’t

my new .htaccess:

ErrorDocument 500 /error.php?id=500
ErrorDocument 404 /error.php?id=404
ErrorDocument 401 /error.php?id=401
ErrorDocument 403 /error.php?id=403


RewriteEngine on
RewriteRule ^tutorials/([0-9]+)/$ /tutorials.php?id=$1
RewriteRule ^tutorials/([0-9]+)$  /tutorials/$1/ [R=301,L]

RewriteRule ^downloads/([0-9]+)/$ /downloads.php?id=$1
RewriteRule ^downloads/([0-9]+)$  /downloads/$1/ [R=301,L]

RewriteRule ^nieuws/([0-9]+)/$ /nieuws.php?id=$1
RewriteRule ^nieuws/([0-9]+)$  /nieuws/$1/ [R=301,L]

RewriteRule ^(.*)/$ /$1.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !forum/(.*)$
RewriteCond %{REQUEST_URI} !(.*)$
RewriteRule ^(.*)$ http://www.freehacks.nl/$1 [R=301,L]

You're replying to a comment left by Emma that was posted on May 31, 2010

Good Article… can anyone reply RaMp6 question?? As im waiting for that reply

You're replying to a comment left by RPN that was posted on June 10, 2010

how to remove the last characters in url?
from /sales/order/view/order_id/1/
to /sales/order/view/order_id/
but yet the correct page still loads.

Or have the /sales/order/view/order_id/1/ show random number or additional numbers within 1

The point is to hide the order_id number from customers who ordered.

You're replying to a comment left by Owen English that was posted on June 27, 2010

Hi, I need to switch caching off for only one file on my site. This file is regularly updated and pulled out to users PCs by our app. But the cache is on and means that the old copies are being received. It’s one file http://www.medistat.net\public_html\newfiles\upgrade.sys that I need to disable the cahe on. How simple is this within .htaccess and what line/s do I need to add to that file??? Help!! Many thanks.

You're replying to a comment left by amit that was posted on July 22, 2010

how i add an encoded code in ht access

like :— i encode id like 7 in encoded format
sewsdf234dfdf:2

RewriteRule
^index-activate-([a-zA-Z0-9]+)\.html$ index.php?action=activate&id;=$1 [L]

You're replying to a comment left by Johan that was posted on November 08, 2010

Hi, I have been trying to redirect pages with an url containign special Swedish characters å, ä and ö. I do not get the redirect to work in this case but it works in those cases where the url does not have any of these charachters. I have done the redirects as follows:

Redirect 301 /produkter/Ljuslampett-Prinsessa.html http://www.varunik.se/kategorier/Personliga-presenter/ “THIS WORKS”
Redirect 301 /produkter/Mugg-och-SkÃ¥l-Flicka.html http://www.varunik.se/designers/ “THIS DOES NOT WORK”

Do you have any suggestions how to do this?

Regards
Johan

You're replying to a comment left by Trish that was posted on December 08, 2010

Hi Kyle,

Thanks for sharing this information. I wonder do you have any comments about using a caching plugin on Wordpress (self hosted) blog? Specifically W3 Total Cache.

I have a problem while using Firefox and Yslow or Google’s Page Speed add ons. Yslow will not recognize Gzip compression or Expire headers info on my site. They are both configured from within the admin panel for W3 Total Cache. I have used other tools (http://www.gidnetwork.com/tools/gzip-test.php and others too) and they report Gzip is working and Expires headers are set.

I guess my real question is should I use a caching plugin or do it myself with the htaccess file and other things like you have mentioned in the article?

Thanks for your help,

Trish

You're replying to a comment left by christine that was posted on March 13, 2011

Hello Kyle, I am also interested in whether a caching plugin is necessary or whether it’s best (and faster) to make the modifications myself.

The reason, is because at first I was using wp super cache but my pages were still loading slowly and now with w3 total cache there are setup issues.

What do you recommend?

Christine

You're replying to a comment left by Anthony that was posted on March 31, 2011

One of the more comprehensive guides that I’ve ever seen in the internet. I were actually looking for information about the rewrite Engine that I know nothing about and regarding caching pages on a website - I didn’t know that htaccess had so many uses! It helped me a lot, thank you.

You're replying to a comment left by mma fight gear that was posted on April 04, 2011

hi…
you have posted a very informative post which will really be helpful and also one question while posting a link through my blogger s account give me error….should i use htaccessess

You're replying to a comment left by Social Bookmarking that was posted on April 08, 2011

Thank you so much for the post, i have started reading that and just after couple of min, i found it very interesting. Just want to say thanks…

You're replying to a comment left by Baxylooca that was posted on April 21, 2011

Do you till this moment pay much for sitting in a buzzing cinema theater where you risk to get your friend’s popcorn and dr. pepper sheded on you? Or do you yet spend your time   buying movies in “Blockbuster” while you can stay at your cozy house? It’s high time to economise your finances, nerves and precious time! Just watch your well-liked HD movies online on <a > http://movie-hit.com </a>. With films online, stop beting on TV and movie premieres. Our films download will help you to cut down on your expenses by actually receiving more:  for one month watch online or download movies for the price of one movie is rented!  Movie-hit <a > site</a> team constantly updates the website with last content, but also doesn’t forget about old films (we go back in time as far as 1902), and invites you to watch series online. We do all possible to give satisfaction the movie gourmand’s tastes with our films online. To hasten your video search, we supplying not only a search by first letter and genre, but also a beyond compare option – search by actor and year - actors. Also, we esteem our clients, so we are all the time anxious to give you a hand with films download process and respond on your questions<a >.</a> You are welcome to send us a message. Don’t miss your chance to taste the movie you long for watching!

You're replying to a comment left by Carol that was posted on May 03, 2011

I have spent many hours now on trying to remove part of an url,

I need to convert the url from this:

http://www.mydomaine.com/index.php?option=com_ezrealty&task=property&Itemid=54&?no_mls=MTXXXXXX

To this

http://www.mydomaine.com/index.php?option=com_ezrealty&task=property&Itemid=54&no_mls=XXXXXX

The X being the listing number (variable).

I have tried all kind of tricks but can’t do it,

Thanks for help,

Carol,

You're replying to a comment left by Ajax Chat that was posted on May 10, 2011

Nice way to guide how to rewrite URLS…

You're replying to a comment left by Rilditotony that was posted on May 21, 2011

ñêà÷àòü ýìóëÿòîðû èãðîâûõ àâòîìàòîâ alcatraz [url=“http://cinematiks.info/music/574-muzika-dlya-molodezhi-50_50-2010.html”>Keygen yxplayer 1.6.5 äëÿ Android</a> ñêà÷àòü assassin s creed letitbit <a >âçëîì ïëàòíûõ àðõèâîâ îíëàéí</a> iphone tunnel suite ñêà÷àòü <a >besplatno dlia telefona</a> 
don t lie ñêà÷àòü <a >íàðåçêè ìð3 2011 ñêà÷àòü áåñïëàòíî</a> ñêà÷àòü ìàøèíû äëÿ gta 3 <a >ñêà÷àòü êëóáíûå ðèíãòîíû 2011</a> ñêà÷àòü power audio editor <a >çâóêè ìîòî íà çàéöåâ íåò</a> 
honda hr v êíèãà ñêà÷àòü <a >áåñïëàòíî ñêà÷àòü íàðåçêè ïåñåí 80õ äëÿ òåëåôîíà</a> àóäèîêíèãó ñêà÷àòü çìååíûø <a >áèêòàéì ðàø ïåñíè ñêà÷àòü</a> ñêà÷àòü êîäû íà gta san <a >áðàò 2 íà çâîíîê</a> 
ñêà÷àòü õèò òîï 40 <a ]ìóçûêà20011 ãîäà[/url] ati mobility radeon hd4330 ñêà÷àòü r-studio 5.3 ëåêàðñòâî ñêà÷àòü red organizer 5.0 ïää 20011 áåëàðóñü ñêà÷àòü ñáîðíèê ðóññêîãî ðîêà

You're replying to a comment left by tourisme corse that was posted on May 31, 2011

Thanks. I needed the redirect thing and I really didn’t know to do it. So know my visitors will access the new file I upload. So I just wanted to say it worked like a charm.

You're replying to a comment left by Paul Loeb that was posted on June 07, 2011

I currently have PHP scripts that work properly, being called like this:
http://www.example.com/user.php/paul
http://www.example.com/tag.php/food

I’m having trouble getting .htaccess to rewrite properly. I’m trying to achieve this:

http://www.example.com/user/paul
http://www.example.com/tag/food

So far, I can get it to redirect /user to /user.php, but the /paul is lost; breaking my script.

My current .htaccess looks like this:

RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET\ /([^.\ ]+\.)+php(\?[^\ ]*)?\ HTTP
RewriteRule ^(.+)\.php$ http://www.example.com/$1 [R=301,L]
RewriteRule ^([^/]+/)*index/?$ http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ http://www.example.com/$1 [R=301,L]
RewriteCond $1 !^([^.]+\.)+([a-z0-9]+)$ [NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*[^/])$ /$1.php [L]

Please help.
Thanks!
Paul

You're replying to a comment left by Thomas that was posted on June 19, 2011

A good place to know about htaccess and urls is here : http://jannaud.fr/htaccess-clean-url-strip-slash, it gave me a good working solution about clean slug urls.

You're replying to a comment left by cinderalla that was posted on July 03, 2011

Hosting uptime refers to the percentage of time the host is accessible via the internet. Many providers state that they aim for at least 99.9% uptime (roughly equivalent to 45 minutes of downtime a month, or less), but there may be server restarts and planned (or unplanned) maintenance in any hosting environment and this may or may not be considered part of the official uptime promise.

You're replying to a comment left by cityville cheats that work that was posted on July 27, 2011

This was quite helpful for me..Thanks to the site owner who helped us..

You're replying to a comment left by modapronnn that was posted on January 05, 2012

Hi all!!!       
are you interested in buy modalert without a prescription online modalert india .           
modalert cheap online modafinil modapro modafinil provigil modalert ems shipping airsealed marketing            
modalert picture modalert buy   http://www.youtube.com/watch?v=tmjORYhocXggeneric modalert modalert online            
generic modalert buy modalert 200 online purchase modalert 200 ?           
modalert no prescription   http://www.youtube.com/watch?v=LYW5wVuiKuUmodafinil cheap            
modapro   http://www.youtube.com/watch?v=r0jHVRJEua4pharmland modalert modalert for sale alertec            
modalert india        
!!!provigil_modafinil!!!         
provigil vs modalert http://www.youtube.com/watch?v=r0jHVRJEua4generic modalert modalert sale        
no prescription modapro modalert modafinil modafinil india            
modalert quality modapro vs modalert   modapro vs modalert buy modalert india ???           
modalert no prescription buy modalert 200mg modalert quality buy modalert online ...