Forum Moderators: phranque

Message Too Old, No Replies

.htaccess with variable

         

ronnyskog

6:31 am on Apr 13, 2010 (gmt 0)

10+ Year Member



Im trying to redirect "http://mysite.com/month.php?user=__public__" to "http://mysite.com/month.php" using .htacces, but with no luck.

I have tried this, but its not working:


RewriteEngine on
RewriteCond %{QUERY_STRING} ^user=__public__$
RewriteRule ^/month.php$ [mysite.com...] [L,R=301]


What is I doing wrong?

g1smd

6:47 am on Apr 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Paths seen by RewriteRule when used in .htaccess are localised.

RewriteRule doesn't 'see' that leading slash, so your pattern can never match.

Remove the leading slash from the pattern.

ronnyskog

6:56 am on Apr 13, 2010 (gmt 0)

10+ Year Member



Thank you :)