/ Published in: ASP
URL: ASP.NET 301 Redirect Page
Expand |
Embed | Plain Text
<%@ Page Language="C#" Title="ASP.NET 301 Redirect Page" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> //Url to redirect this page to Uri urlRedirect = new Uri("http://snipplr.com/view/11473/aspnet-301-redirect-page/"); private void Page_Load(object sender, System.EventArgs e) { //Set Response Response.Status = "301 Moved Permanently"; Response.AddHeader("Location", urlRedirect.AbsoluteUri); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title><%= Page.Title.ToString() %></title> </head> <body> <p>This page has moved to <a href="<%= urlRedirect.ToString() %>" runat="server" /></p> </body> </html>
You need to login to post a comment.
