Forum Moderators: phranque

Message Too Old, No Replies

htaccess 301 Redirect Issue - Please Help?

         

MisterT

11:51 pm on May 14, 2010 (gmt 0)

10+ Year Member



I'm attempting to 301 redirect a couple of urls to a new domain...the 2 redirects look like this in htaccess:

Redirect 301 /category/category-name/ http://newdomain.com/newcategory/newcategory-name/newsubcategory-name

Redirect 301 /category/category-name/subcategory-name/ http://newdomain.com/newcategory/newcategory-name/newsubcategory-name

The first redirect goes smoothly. The problem is the 2nd redirect goes to this invalid url on the new domain:

http://newdomain.com/newcategory/newcategory-name/newsubcategory-name/subcategory-name/

The problem is, the old subcategory name is getting added on to the end of the url a the new domain for some reason. I'm sure this is just my ignorance and I set-up the redirect incorrectly. something about the first redirect is screwing with the 2nd or vise/versa.

Can anyone help me out here? :)

[edited by: jdMorgan at 4:32 pm (utc) on May 15, 2010]
[edit reason] de-linked URLs [/edit]

g1smd

7:09 am on May 15, 2010 (gmt 0)

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



Use
RewriteRule
in place of
Redirect
and you'll have more control over which URL requests are redirected and where the user is sent.

Don't forget to add the
[R=301,L]
flags for correct operation.