Yesterday we wrote a blog entry on the best way to move to a new site and explained that the best way was using a 301 redirect.
We’ve since been asked how you do that so here goes.
If you are using apache for your webserver then the best way is using a .htaccess file in the root of your old website.
In the case below we are moving the website from website 1 to website 2 – the entries for website 1 are relative while the redirect to website 2 must include the full domain in order to work.
Our files on website 2 are named the same as they were on website 1, the website files must remain in place in website 1 for this to work – our .htaccess entries are below:
RewriteEngine on
Redirect 301 /index.html http://www.website2.com/
Redirect 301 /links.html http://www.website2.com/links.html
Redirect 301 /about-us.html http://www.website2.com/about-us.html
Redirect 301 /testimonials.html http://www.website2.com/testimonials.html
and so on – we can see here that the pages are being redirected to the counterpart pages on the new website.
In the example above we have used the same pages names on the new website this does not have to be the case – we could for example use:
Redirect 301 /about-us.html http://www.website2.com/old-business.html
or we could redirect into a sub directory of the new site and so on.
If you are not able to use a .htaccess file then the same can be achieved using php.
If you are using a windows server then .htaccess file will not work.
We’ll explain in another post how to redirect and send a correct 301 header using php or on a windows server.







0 comments ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment