Posted By

jonhenshaw on 04/16/07


Tagged

redirect Net ASP 301


Versions (?)

ASP .NET 301 Redirect


 / Published in: ASP
 

This redirects visitors to a new URL using a 301 redirect. Using a 301 redirect is the safest way to let search engines like Google, Yahoo!, Live and Ask know your address has changed.

  1. <script runat="server">
  2. private void Page_Load(object sender, System.EventArgs e)
  3. {
  4. Response.Status = "301 Moved Permanently";
  5. Response.AddHeader("Location","http://www.domain.com");
  6. }
  7. </script>

Report this snippet  

You need to login to post a comment.