I decided to help my buddy out with a website he is working on. It has over 2000 pages all which are in html. In order to make it a bit more dynamic we are changing all of the pages to .php and updating the code to be more flexible and easier to update. We should incorporate a database and make the website data-driven however we’ll forget about that for now and focus on the topic at hand.
So while changing all the pages to .php I realized that most of the pages have anywhere from a few hundred to over a thousand other pages linking to them. Instead of constantly updating every page on the site and uploading it to the server I decided to use a redirect on the old .html pages in order to alleviate any concerns about missing or incorrect links. I do not want forget to change a single link, since we all know that will end up being the most important link of all!!!
Anyway, I decided to incorporate a simple HTML redirect.
<head><meta HTTP-EQUIV=”REFRESH” content=”0; url=http://www.yourdomain.com/index.html”></head>
The redirect solution is not ideal in many cases, but can be useful when absolutely needed. In this case, I no longer have to worry about a single incorrect link. Any page that linked to abc.html is now being redirected to abc.php. This is a very simple way to avoid major headaches and speed up the updating process. The main thing to keep in mind is to delete everything from the old HTML page except for the redirect code. This will help with the redirect speed. If you comment out all the code on the .html page, the server will still load it before redirecting to the new page!
Data Source: Web Source