When a website has been online for a while, and needs some maintenance, it’s sometimes a necessary evil to change the structure. The disadvantage of this is that this mostly influences the links to the indexed pages. The search engines (and thus also your visitors) will get a 404 (page not found), where your pagerank and such will be lost.
What can you do? Simply put a 301 redirect on it. This indicates towards search engines that the page has been moved permanently. In effect the bot will adjust the referenced link in it’s database, so that it’ll be correctly shown in the future. How to do this?
php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
asp
Response.Status="301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com/");
asp.net
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
Ruby on Rails
def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.new-url.com/"
end