301 Redirect on a Windows Server
April 2004
If you are not using a Unix or Apache server, you
can still do a 301 redirect, if you are using .asp
pages. Here's what you do:
Place the following code above your <html> tag or <!DOCTYPE>,
if you have one:
<%@
Language=VBScript %>
<%
response.status="301 moved permanently"
Response.AddHeader "Location", "http://www.domain.com/file-location.html"
%>
If you are using .asp.net
pages, the code should look like:
<script runat="server">
private void Page_Load(object sender,
System.EventArgs e)
{
response.status = "301 moved permanently";
Response.AddHeader("Location","http://www.domain.com/file-location.html");
}
</script>
The URL after "Location" should be
the exact location to which you want the page to
redirect.
Not Using a Windows Server?
Click here for
instructions on creating a
301 Redirect.