ASP Redirect Script examples

Although we only support one website per hosting account, you are allowed to use scripting methods to host multiple websites from one hosting account. We do not support this type of programming, so this is for information purposes only.

The following are some sample ASP scripts that you can use.

Point a domain name to a specific file:

<%

If Request.ServerVariables("HTTP_HOST") = "www.example.com" Or Request.ServerVariables("HTTP_HOST") = "example.com" Then

    Response.Redirect("http://" & Request.ServerVariables("HTTP_HOST") & "/test.asp")

End If

%>

 

 

 

Point a domain name to a specific folder:

<%

If Request.ServerVariables("HTTP_HOST") = "www.example.com" Or Request.ServerVariables("HTTP_HOST") = "example.com" Then

    Response.Redirect("http://" & Request.ServerVariables("HTTP_HOST") & "/example/")

End If

%>

 

 

 

Point a domain name to a specific file in a subfolder:

<%

If Request.ServerVariables("HTTP_HOST") = "www.example.com" Or Request.ServerVariables("HTTP_HOST") = "example.com" Then

    Response.Redirect("http://" & Request.ServerVariables("HTTP_HOST") & "/example/example2/file.asp")

End If

%>