% 'This ASP script originally lived at http://evolvedcode.net/ for the 'original version of this script and a wide variety of other 'scripts, please visit the site. Sub Relocated( ByVal sNewURI ) 'Type convert the input to a string datatype sNewURI = CStr( sNewURI ) 'Append current server name to be standards compliant, ' but first check that the URL is absolute If StrComp( Left( sNewURI, 5 ), "http:", vbTextCompare ) <> 0 _ And Request.ServerVariables("HTTP_HOST") <> vbNullString _ And Left( sNewURI, 1 ) = "/" Then 'Check if we have the HOST variable to work from sNewURI = "http://" & Request.ServerVariables("HTTP_HOST") & sNewURI End If 'Set the response status to 301 to indicate ' the resource has moved permanently Response.Status = "301 Moved Permanently" 'Set the responses location header to point ' to the new location of the resource Response.AddHeader "Location", sNewURI 'Finally print out some html so that basic ' browsers do not get stuck in this location %>