Forum Moderators: open
[webmasterworld.com...]
<script language="vb" runat="Server">
Sub redirect301(whereTo As String)
Response.Status = "301 Moved Permanently"
Response.Addheader("Location", whereTo)
Response.End
End Sub
</script>
in Classic ASP, add this function to your page...
<script language="vbscript" runat="Server">
Sub redirect301(whereTo)
Response.Status = "301 Moved Permanently"
Response.Addheader "Location", whereTo
Response.End
End Sub
</script>
Then in the same way as you'd use this code for a 302...
Response.redirect("http://www.microsoft.com/")
Use this code for a 301...
redirect301("http://www.microsoft.com/")
I have used this ASP Code, it worked for my site.
<%
PathInfo = Request.ServerVariables("PATH_INFO")
ServerName = Request.ServerVariables("SERVER_NAME")
Iswww = InStr(ServerName,"www.mysite.com")
If Iswww < 1 Then
NewLocation = "http://www.mysite.com" & PathInfo
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", NewLocation
End If
%>
Any comment on this code please welcome.
Thanks for the reply.