PDA

View Full Version : 301 redirect not working


krisleech
04-05-2005, 05:47 AM
I have setup a perm 301 redirect from one folder (Shop) to another (NewShop). The orignal folder which has my shopping cart in has the .htacess file which contains:

Redirect permanent / http://www.mydomain.com/shop/NewShop/products.php

I upload this to the old shopping carts folder, http://www.mydomain.com/shop/Shop. But when i try and access this folder I get redirected to:
http://www.mydomain.com/shop/NewShop/products.phpshop/Shop/

In other words the redirect works accept it adds the old folder (shop/Shop/) to the end of the URL?!?

The filename is added to the URL as well if you try and access a file in the old folder.

Can anyone help solve this?

kitchin
04-05-2005, 11:38 AM
Take a look at http://httpd.apache.org/docs/mod/mod_alias.html
I think you want
RedirectMatch 301 ^/shop/Shop/ http://www.mydomain.com/shop/NewShop/products.php

DogAndPony
04-05-2005, 12:03 PM
RedirectMatch 301 ^/shop/Shop/ !!!! Where have I been? Under some rock? I never heard of that! Wow... Gotta make a big desktop sticky outta that! Thanks!

krisleech
04-05-2005, 01:28 PM
thanks kitchin that worked a treat, i dont know why because the link dont work. But anyway thanks a lot.

kitchin
04-05-2005, 01:38 PM
I fixed that link. Apache docs are pretty good. Too brief sometimes, but not too cluttered either.