Wednesday, June 21, 2006

How to redirect a page, the right way.

Good information to keep in mind for updating websites, using the 301.
http://www.stevenhargrove.com/redirect-web-pages/


Since, I'm developing mostly in ASP.Net, here is his sample code on how to use it.


<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com/");
}
</script>

No comments:

Post a Comment