Canonical URL and URL redirection issues is a major concern for most webmasters. Although many administrators are evil bitten by the original address the problem, others who were trying to make a redirect (to avoid canonical problems), but could not be conducted properly often bite so strong, or even worse.
While Google has the opportunity to bring their favorite URL Webmaster Central, where the administrator can access and specify the URL of the form that he wants Google, other search engines have not yet reached this point. In addition, there are still many webmasters who are not familiar with this feature that Google Webmaster Central. In addition, the redirection URL can be a useful method for various other situations, especially if you access a website or re-development - that causes a change of URLs already indexed by search engines. I am sure none of us wants to take the pain to start from scratch with the new addresses, or lose all your links to the old site probably deserved years. effective URL redirection can actually save them all.
I tried to create a comprehensive guide for redirection, and ways to implement them.
Types of Redirection
Example:
<script type="text/javascript">
<!--
window.location = "http://www.newurl.com/"
//-->
</script>
header("Location: http://www.newurl.com");
exit();
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.newurl.com"
response.end
%>
Response.Clear();
Response.Status = 301;
Response.AddHeader("Location", strDestinationUri);
Response.Flush();
Response.End();
}
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.newurl.com");
}
</script>
<.cfheader name="Location" value="http://www.newurl.com">
response.setStatus(301);
response.setHeader( "Location", "http://www.newurl.com" );
response.setHeader( "Connection", "close" );
%>
* Meta Redirect
Though there is no official statement from Google , from the word of mouth information it appears that they treat a Meta redirect as 302 redirection. Yahoo however, has clearly outlined there policy about handling redirections, stating that they treat Meta redirects set to 0 seconds ("little or no delay") as 301 redirection and anything above 0 seconds ("noticeable delay")is treated as a 302 redirection. MSN does not drop the original URL from their index on adding the Meta Refresh tag but also indexes the new URL, which indicates that they are treating Meta Redirection as 302 redirect.
Example:
Meta Redirect ( Using Meta Refresh Tag)
Add this line in between <head></head> of your webpage to redirect that page in 0 seconds to http://www.newurl.com. You can increase the delay in redirection by changing "0" to some other value. Remember to replace http://www.newurl.com with the actual URL of your new page.
How To Implement 301 Redirection / Website redirection
Redirection can be implemented at two levels. Server Side redirection can be either a 301 redirection or a 302 redirection, however, as 301 redirection is the most search engine friendly method, I have explained the 301 redirection only in this article.
Choose wisely mentioned above code.
Redirection scripts are extremely important and can be very helpful if applied properly not just for 301 redirection or URL canonicalization issues but also to resolve several situation specific problems. In all cases server level redirections should be the first option and client side redirection should be considered in cases only when you do not have control over your server.
1 comments:
Post a Comment