cancel
Showing results for 
Search instead for 
Did you mean: 

301 Redirect

remfish
Newbie
Posts: 3
Registered: ‎20-07-2009

301 Redirect

I want to redirect a page which has been deleted and now gives 404 to a new page on the same site.
Have entered the following format into an htaccess file and uploaded to the root.
Redirect  301 /olddirectory/oldfile.html http://mysite.co.uk/newdirectory/newfile.html
However it does not work.
Only other instruction in the htaccess file is the error not found file which works ok.
I think this is a relatively simple problem but can't find the answer.
Help would be appreciated.
Thanks
2 REPLIES 2
Spider
Community Veteran
Posts: 1,100
Registered: ‎05-04-2007

Re: 301 Redirect

Just checked my own Redirect 301 and am guessing you might need to use http://www.mysite rather than just http://mysite. The other not so obvious problem could be the that either file is incorrectly named as the names are case sensitive.
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: 301 Redirect

Hi there,
Is the request you are rewriting correct, i.e. the path has to start from the root of your website, usually your htdocs directory.
e.g.
If I have the following structure:

htdocs/
htdocs/index.html
htdocs/stuff
htdocs/stuff/.htaccess
htdocs/stuff/index.html

If I want to redirect www.mysite.com/stuff/someotherstuff.html to google using htdocs/stuff/.htaccess I'd need to put something like:

Redirect 301 /stuff/someotherstuff.html http://google.com/

and NOT
Redirect 301 someotherstuff.html http://google.com/

See what I mean?
HTH