Posted: April 5, 2011 in Uncategorized

How to redirect a subdomain to a subdirectory?

<%
If InStr( UCase(Request.ServerVariables(“SERVER_NAME”)),  UCase(“subdomain1.YourHostedDomainName.com”) ) > 0 Then
        Response.Redirect(“/subdomain1”)
ElseIf InStr( UCase(Request.ServerVariables(“SERVER_NAME”)), UCase(“subdomain2.YourHostedDomainName.com”) ) > 0 Then
        Response.Redirect(“/subdomain2”)
ElseIf InStr( UCase(Request.ServerVariables(“SERVER_NAME”)), UCase(“subdomain3.YourHostedDomainName.com”) ) > 0 Then
        Response.Redirect(“/subdomain3/home.asp”)
End If
%>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s