Dave
Dave

Reputation: 23

Redirect 301 Not working the way I intended it to!

Trying to get a simple 301 redirect with htaccess using this code: Redirect 301 /cat/radiator-cages/product/radiator-support-cage/ http://www.mysite.com/product/radiator-cages/custom-radiator-support-cage/

The results are sending me to http://www.mysite.com/product/radiator-cages/custom-radiator-support-cage/?page=cat/radiator-cages/product/radiator-support-cage

Any idea what I'm doing wrong? Thanks in advance for any help.

--Update--

RewriteCond %{HTTP_HOST} ^mysite.com [NC] 
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
RewriteRule ^product/(.*)/(.*)/$ /index.php?page=product&parent_url=$1&product=$2 [L,NC]

Redirect 301 /cat/radiator-cages/product/radiator-support-cage/ http://www.mysite.com/product/radiator-cages/custom-radiator-support-cage/

Upvotes: 0

Views: 466

Answers (1)

Ryan Matthews
Ryan Matthews

Reputation: 1043

I suggest trying to use the Redirect 301 statement first.

Your htaccess should then look somthing like this

    Redirect 301 /cat/radiator-cages/product/radiator-support-cage/ http://www.mysite.com/product/radiator-cages/custom-radiator-support-cage/
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mysite.com [NC] 
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
    RewriteRule ^product/(.*)/(.*)/$ /index.php?page=product&parent_url=$1&product=$2 [L,NC]

Edit:

   RewriteEngine on
   RewriteCond %{HTTP_HOST} ^mysite.com [NC] 
   RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
   RewriteRule ^/cat/radiator-cages/product/radiator-support-cage/$ http://www.mysite.com/product/radiator-cages/custom-radiator-support-cage/ [R=301,L]
   RewriteRule ^product/(.*)/(.*)/$ /index.php?page=product&parent_url=$1&product=$2 [L,NC] 

http://www.gerronmulder.com/common-seo-rewrite-rules-for-apache-using-htaccess/

Upvotes: 1

Related Questions