Forum Moderators: phranque

Message Too Old, No Replies

Redirect 301 i just can not get it to work

         

zeus

7:33 pm on May 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have 5 versions of my frontpage, which is bad of cause, so i want to make a 301.

This one:
Options +FollowSymLinks
RewriteEngine on
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

works great, but the next i need to redirect is:

/index.php?cat=chcat3
and 3 more like that, but it dossent matter how i do this it dont work, im no expert in apache, so maybe im doing something wrong.

g1smd

8:14 pm on May 14, 2011 (gmt 0)

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



Make room in the RewriteCond RegEx pattern for the
\.php\?cat=chcat3\ HTTP/
parameter to be detected.

Additionally change the
.*
pattern (two places) to
([^/]+/)*
as that code runs a LOT faster.

zeus

8:56 pm on May 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



could you make the code as it should be, im not quiet sure if i get it, also thanks for the reply.

zeus

9:48 am on May 17, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



could anyone create a code for this, I dont get it to work, thanks in advance