If you have never moved your website before, you will probably think that it is a rather trivial matter. Certainly something that does not warrant an article - after all, it's only a matter of copying files over to the new server. Or is it?
Actually there's more to it than meets the eye. I have moved my other website thefreecountry.com many times in its rather long history, both with changes in the URL (back when it was without a domain name) and when I moved the actual domain ("thefreecountry.com") between web hosts. It seems to me that each time I move, I overlook some important aspect.
I'll deal with both the mundane aspects - the checklist of things you need to do - as well as the more problematic situation of helping you minimise your loss of visitors.
Note that there are some differences between moving your site when you have your own domain name and moving it when you do not. I'll try to cover both these cases in this article.
The funny thing about websites is that no matter what everyone recommends officially, there continues to be people (more than you think) who actually only maintain only one copy of their website - the one on the web server.
If you're one of those, make sure you make a copy of your website on your computer. This has to be done even BEFORE you inform your old web host that you are terminating. In fact, it may be wise NOT to tell your old host that you're terminating just yet, since some people who run web hosts react badly. They might terminate your account before you're ready, throttle down your bandwidth or other such petty things. If you don't believe that such things happen, just browse the various webmaster newsgroups and you'll see that even worse things occur.
To copy your files, just use the method that you normally take to upload your files, and download them instead. If you do it through FTP, then copy them through FTP. If you use a browser to access your site via your web hosts' online "File Manager" (or the like), then do it that way.
The next step is to check all your internal links to make sure they do not have any hardcoded URLs to the old address. This is not a problem if you have your own domain (since your URL will not change in that case).
You might want to consider making all your internal links relative links to simplify your relocation process. You can always hardcode links again later if that's what you prefer.
If your old web host forced you to add some banner code or text link to your pages, this is a good time to delete them.
Note that your old site is still active. At this point, no one knows you're going to shift yet (except of course you and your new host).
Upload your pages to your new host. Test all your pages. Make sure they work. Remember - you have not yet officially shifted. If you have your own domain name, you have also not yet updated your DNS to point to your new host. The whole point of this exercise is to make sure everything is functional on both ends.
If you have your own domain name, and you're shifting it with your website, update your DNS records with your registrar only when you're satisfied that your new site works as intended.
If you have a new domain name (and you did not have one previously), simply point the domain name to the new host. Do NOT point the domain to your old host first for fun. This will cause additional complications as well as delays in your domain name propagation. Propagation seems to be faster when you're pointing a brand new domain than when you're switching a domain between IP addresses.
Although the registrars tell you that the update should be completed within 48 hours or so, in practice it actually takes about a week for all the name servers around the world to catch up with the new location of your domain. In that interim, only some parts of the world will be able access your domain at your new host; the rest will continue to access the old site. Note that even if you see the new site in your browser, it is not necessarily true that others will see the new site. This is normal - do not worry.
i. Do not delete the old site during this interim. This will help you avoid losing visitors. Just maintain two copies of your site. Endure the inconvenience for this period - it's only a short term hassle.
ii. At this point in time, do not put up a page on your old site redirecting people to your new domain. It may seem like a good idea, but it isn't. It was one of the silly things I did in one of my moves and I really regretted it.
Why? While you may be able to follow your redirection page to your new host, it merely means that your ISP has updated their name servers so that your domain points to the new host. People who use ISPs elsewhere in the world may not be in the same situation. Some ISPs are very slow to update their name servers. When your visitors using those ISPs click on your redirection, they'll be redirected back to your old site again (since the domain is still pointing there for them). It'll be like an infinite loop - they'll keep going back to the same page redirecting them elsewhere.
I learned about this because I accessed the Internet using different ISPs. I was able to reach my new host with one ISP, but was trapped in an infinite loop with the other.
In general, if you're moving domains, you will not need to put a redirection page. Period. I had to, because at that time, my website was being accessed via both the domain name, which was new then, and the old URL given by the free web host where the site was situated.
iii. Do not tell your old host just yet. Give it at least one week where both sites continue to run concurrently. This applies even if you're paying both hosts monthly fees. Plan to have both sites up for at least that week.
After the week (where you maintain identical copies of your site on both your old and new host) is up, what you do next depends on whether you moved your domain name or whether your URL changed when you changed web hosts.
If you had your own domain name previously, which you moved with your site, you have little else to do. You can simply terminate your account with your old web host, and you're done (or if you can afford it, wait a week or so longer to make sure every ISP's and search engine's DNS records have been updated). Your visitors will probably not even know that you changed hosts. Your search engine listings are not affected since they still point to the right place: your domain. Everything is, hopefully, dandy.
If you have been hosting with free web hosts or your old ISP without your own domain name previously, you're now faced with the prospect of losing visitors. Visitors will be lost because they follow old links to your site (whether from search engines or other sites) and will not find it there. Some loss of visitors is actually unavoidable, but you can do much to reduce the number lost.
The most obvious thing to do is to put a page on your old site redirecting your visitors to your new location. But, as I have found, there are problems with this approach.
For the uninitiated, there are basically two ways to write web pages that redirect your visitors:
The problem with the first variety is that most people don't bother to follow links. If they do not see what they want instantly, they'll just hit the back button and proceed elsewhere. This is a well-documented characteristic of Internet users.
The problem with the second variety is that you might lose your search engine listing (depending on which search engine you're talking about). Search engines generally do not like redirection pages. If they see a redirection page when their spider is returning to check out your site, your old URL will be deleted from their index. You don't want your old URL deleted from their index if possible because your new URL is still new - it takes time before your new URL is listed in the search engines (sometimes it can take a month) even if you immediately index it when your site becomes "live".
The best solution I can think of is to modify your old site's .htaccess file. Some web hosts allow you to put a .htaccess file in your web directories telling your web server what to do when a visitor tries to access a file on your site. Check your old web host's documentation to see if this can be done. In general, only web hosts that use the Apache server will have such a facility.
For each page that is under the old URL, put a Redirect statement pointing it to the new location. Take the following line for example:
Every time your visitors try to access oldfilename.html on your old site, the server will tell their browser to load file.html from your new site instead. They will then be transparently redirected to the new host without the requirement that they click on a link, etc. If they do not look at the location bar on their browser, they might not even know that they had been redirected.
Search engines like Google, it is claimed, will also follow the link to index the new URL, and transfer the page rank of your old page to the new one. If you don't know about Google's page ranking strategy, see my article Google Search Engine Ranking Tips at http://www.thesitewizard.com/archive/google.shtml. I don't think all search engines do this automatically though. Like I said, there will be some losses: you can only reduce them, not avoid them altogether.
If you're afraid that you might accidentally forget to list some page in your list of redirections, you can put a simple catch-all that redirects any remaining URLs to your new main page. The catch-all is probably only useful in catching humans that arrive at your site, and won't help you with your search engine listings. It involves simply redirecting all file not found errors to the main page of your new URL:
If you don't have .htaccess support on your old site, I guess the next best thing is to use one of the other less-desirable methods mentioned above. Although there are problems with those methods, having some sort of redirection page is better than having nothing at all.
To set up an automatically redirecting page, put the following META tag in the <head> section of your web page. Keep it all in one line in your page.
The "0" in the line specifies that the browser should wait 0 seconds before redirecting. If you want to display some sort of message, you can always change that to (say) 5 to tell the browser to wait 5 seconds. The tag would then read:
Even if you wait "0" seconds, you should still include some sort of short message in the body of your web page together with a clickable link to the correct page on your new site. This is because some old browsers might not support the META refresh tag that is used here. A visible, clickable link will give your visitors an alternative way to get to your actual page.
Note that "0" and the new URL are part of the same string that is assigned to the "content" attribute. The opening inverted commas (ie, quotation marks) are before the time ("0" in our case) and the closing inverted commas are after the URL. The URL itself does not begin with any quotation marks.
If your web server (old and new) has logs, or if you have a statistics counter that tracks referrals to your website, make a list of all the sites that sent visitors to your site. Visit those sites and see if they are still referring to your old URL. If so, you might want to inform the webmaster of that site of your new URL.
If your old URL is listed in any directories, you should also take the trouble to update them. Likewise, you will want to quickly submit your new URL to the search engines. Note that some search engines take forever to list a new site, so you just have to be patient.
You can also search for links pointing to your old URL by entering either that old URL or the name of your website into the search engine and look at what turns up. In the case of Alta Vista, it is possible to search for links to your site by preceding your URL with a "link:" prefix.
How much time do you have to update the links? It really depends. Theoretically you have as much time as you want, as long as you continue to maintain your old hosting account where you can set up redirections to your new URL. In practice however, free web hosts (especially the smaller ones) sometimes notice that an account has gone dormant and will remove it. Redirection pages also tend to lose some people along the way (not everyone follows the redirection).
My experience is that it is very difficult to exhaustively remove all links pointing to your old URL. Some webmasters can't be bothered (particularly the webmasters of sites that have not been updated for years); some cannot be traced (no email address on the site); and sometimes you fail to notice the odd site or so that rarely sends you traffic. Till this day, I'm still receiving redirected traffic at my very first web host set up in 1996 for (the predecessor of) thefreecountry.com!
In general, no matter what you do, if you're changing URLs, you're bound to lose some visitors. Hopefully, the tips given above will help you reduce your losses in the confusion surrounding the move. At the very least, you will have avoided some of the problems I encountered when I moved my sites.
Do you find this article useful? You can learn of new articles and scripts that are published on thesitewizard.com by subscribing to the RSS feed. Simply point your RSS feed reader or a browser that supports RSS feeds at http://www.thesitewizard.com/thesitewizard.xml. You can read more about how to subscribe to RSS site feeds from my RSS FAQ.
This article is copyrighted. Please do not reproduce this article in whole or part, in any form, without obtaining my written permission.
It will appear on your page as: