Entries Tagged 'Webmaster miscellany' ↓

301 redirect continued

We promised yesterday that we’d post how to perform a 301 redirect if you do not have mod-rewrite enabled or the ability to add a .htaccess file or if you are using a windows server.

To perform a correct 301 permanent redirect the User Agent visiting the webpage (maybe a web browser or search engine spider) must be gieven the correct http status code in the header that it receives when it requests the page.

In PHP we can perform the function like this by adding the following code to the top of the webpages of the old site:

<?php
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.website-2.com” );
?>

* note that you’ll need to do this for each page that you want to redirect

On a windows server you can redirect the whole site or a subfolder from the IIS management snapin:
Right click on the website in the management console tree and choose properties
From there select the home directory tab.

At the top of the tab is should show a message worded like:
‘When connecting to this resource, the content should come from:’
Select the final of the three radio buttons ‘A redirection to a URL’
Under this put the URL in the input field marked ‘Redirect to:
Then check the final checkbox ‘A permanent redirection for this resource’.
Finally click on apply / ok – job done.

Of course you very possibly won’t have this level of access on a windows hosting server in which case you can perform the redirect using ASP.

In the top of each ASP you would need to add:
<%
Response.Status=”301 Moved Permanentlly”
Response.AddHeader “Location”,”http://www.website-2.com/newpage.asp”
%>

  • Share/Save/Bookmark

Using a 301 redirect to move your website

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.

  • Share/Save/Bookmark

Moving to a new website

Sometimes you may find that your business outgrows your website or there may be another reason to move like a change of business name or just a rebranding.

If you are moving your website to a new domain then there are some important steps that you should follow to ensure the switchover is as painless as possible for you, your customers, and the search engines.

You’ll need to keep your old website up and running for some time after the switchover so don’t just turn it off as this will cause problems if the pages suddenly no longer exist.

You’ll need to perform a 301 redirect (permanent redirect) from your old webpages to your new ones.
Your old webpages will still exist on the old website but nobody will be able to visit them as they’ll be automtically redirected to your new site and it’s new pages.

If the pages on your new website cover the same areas as the old site then you should redirect each of the old pages individualy to the new pages (this is why the old website and all of the old pages must remain active) otherwise when people follow old links to your site or old page info in the search engines they will not go to a 404 not found page on your new website.

Redirecting will make the indexing of your new site by the search engines much more efficient. If you do not redirect then all of your old website pages must wait to fall out of the searche engines (can take months) and then for your new ones to be indexed and then ranked.

With a 301 redirect they just supersede the old pages naturally and you still get the link power from the original pages.

After this you should log into your Google webmaster tools account and verify the new website and then request a redirect through the control panel. This isn’t absolutely necessary but Google recommend it and its easy to do.

Then you just wait for the new website to take over from the old one. After 6 months you can then remove the old website.

  • Share/Save/Bookmark