I am trying to do the following. I have two domains. Domain1.com and Domain2.com. Both are hosted with different companies. I want to put Domain2.com with the same host as Domain1.com, as a subdirectory. I am having trouble with the coding.
<%
sname = Request.ServerVariables("SERVER_NAME"
sname = ucase(sname)
if InStr(sname,"DOMAIN1.COM"
<> 0 then
response.redirect "/subdir/home.aspx"
else
response.redirect "homepage.aspx"
end if
%>
Now first off, I am not sure if "DOMAIN1.COM" is what I should be using with the InStr. Also, my homepage.aspx is the page Domain1 users default to.
The code at the top of homepage.aspx begins with several import statements. Like <%@ Page Language="VB" %> etc.
I try putting the code after those statements and before my <script> tag. When I save it, the code is put after the <body> tag.
I hope I am not too confusing. I want users that want Domain1.com to go to homepage.aspx. Those wanting Domain2.com to go to /subdir/home.aspx.
Thanks for any help.
<%
sname = Request.ServerVariables("SERVER_NAME"
sname = ucase(sname)
if InStr(sname,"DOMAIN1.COM"
response.redirect "/subdir/home.aspx"
else
response.redirect "homepage.aspx"
end if
%>
Now first off, I am not sure if "DOMAIN1.COM" is what I should be using with the InStr. Also, my homepage.aspx is the page Domain1 users default to.
The code at the top of homepage.aspx begins with several import statements. Like <%@ Page Language="VB" %> etc.
I try putting the code after those statements and before my <script> tag. When I save it, the code is put after the <body> tag.
I hope I am not too confusing. I want users that want Domain1.com to go to homepage.aspx. Those wanting Domain2.com to go to /subdir/home.aspx.
Thanks for any help.