301 Moved Permanently - Redirecting URLs with ASP

If you are utilizing .asp (Windows Active Server Pages) as the underlying technology of your Windows IIS hosted websites, there is a simple 301 permanent redirect method that you can utilize without involving a server administrator. This 301 method allows you to quickly implement a 301 Moved Permanently status from the old-page.asp to the new-page.asp. Here is how it works...

Take the old-page.asp that is being renamed or moved and remove all of the code. Place the below code in place of the old HTML/XHMTL.

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.yourdomain.com/new-page.asp"
%>

ASP.NET Version

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


HTML redirect 301 response codes asp moved page moved asp.net


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site