Forum Moderators: open

Message Too Old, No Replies

Please help verify 301 redirect procedure

...a quick sanity check

         

pgp566

7:40 pm on Apr 19, 2008 (gmt 0)

10+ Year Member



I am doing a major update to my website - it started in 1997 and has evolved (with no attention to design) to the point where I have 88 html pages in the root folder(!) I am moving them all to new folders (in same site) and need to redirect the search engines. I started off using the meta "refresh" tag but I understand this is not so good - I should use 301 redirects instead.

I have not used 301 redirects before. Assuming I have moved the file "m100.htm" from the root to the "galaxies" folder, please can you help verify if the following is the right construct:
"redirect 301 /m100.htm http://www.example.com/galaxies/m100.htm"

So I would have 88 lines like that (one for each redirect) all in the file .htaccess? Do the lines have to be separated?

And the .htaccess file goes in the root folder on the server? The root folder on the server is called /public so I assume this is where it goes?

Sorry for the dumb questions - a quick sanity check would really help as this is quite a big operation especially as I have never done it before!

Many thanks
Philip
--

[edited by: encyclo at 11:40 pm (utc) on April 19, 2008]
[edit reason] please use example.com [/edit]

D_Blackwell

9:30 pm on Apr 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The construct is correct:
redirect 301 /m100.htm http://www.example.com/galaxies/m100.htm

One per line. As many as you need. And just put the .htaccess in root along with your root index.htm(l)

pgp566

8:03 pm on Apr 24, 2008 (gmt 0)

10+ Year Member



Thanks very much - I really appreciate the confirmation.

I now have a .htaccess file complete with 88 301 redirects. The problem now is that the server does not seem to accept the file but I'll post a new message as it's really a new topic.