G
Gpr0496
Exactly how do you get a 301 redirect to work....i have researched for the
last few hours, and am having no luck. The code I found for a windows based
server is
<%
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.newdomain.com/page.html"
Response.End
%>
or
<%
If (InStr(Request.ServerVariables("QUERY_STRING"), "oldpage.htm") <> 0) Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "newpage.htm"
Response.End
ElseIf (InStr(Request.ServerVariables("QUERY_STRING"), "oldpage2.htm") <> 0)
Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "newpage2.htm"
Response.End
Else
Response.Status = "404 Not Found"
End If
%>
Which code is correct and what do I do with it? Do I add the script on the
page that I want to redirect (if so, exactly where do I place it, or do I
create a new page?. If I create a new page, what do I save it as? All of my
files are htm. Help!!!!! Thanks again.....
last few hours, and am having no luck. The code I found for a windows based
server is
<%
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.newdomain.com/page.html"
Response.End
%>
or
<%
If (InStr(Request.ServerVariables("QUERY_STRING"), "oldpage.htm") <> 0) Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "newpage.htm"
Response.End
ElseIf (InStr(Request.ServerVariables("QUERY_STRING"), "oldpage2.htm") <> 0)
Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "newpage2.htm"
Response.End
Else
Response.Status = "404 Not Found"
End If
%>
Which code is correct and what do I do with it? Do I add the script on the
page that I want to redirect (if so, exactly where do I place it, or do I
create a new page?. If I create a new page, what do I save it as? All of my
files are htm. Help!!!!! Thanks again.....