"Mr B" <la*****@hahaha.com> wrote in message
news:ir********************************@4ax.com...
Howdy all,
I have 2 domain names that both go to the same website. For example, if
www.XXXX.com is the primary name for the website, if you type in www.XXXX.com or www.YYYY.com, they
both go www.XXXX.com for the same website jsut via different names.
What I want to do is take one of those, and redirect them to a sub folder.
So if someone goes to www.XXXX.com they just go to the normal Index page. But if someone goes
to www.YYYY.com, they go to the index page which would do a check to see where they tried to go, and
would redirect them to www.XXXX.com/folder
Is there any way to do this via Javascript?
Thanks.
I have been using an asp page to handle something similar to this. Remane
your index.htm page of
www.xxxx.com to index.asp. Then the contents below
will handle the redirect. Try something like this:
<%
dim serverName
serverName = request.ServerVariables("SERVER_NAME")
if inStr(1,serverName,"xxxx.com",1)>0 then
response.Redirect(
www.xxxx.com/home.htm)
elseif inStr(1,serverName,yyyy.com,1)>0 then
response.Redirect(
www.xxxx.com/folder)
else
response.Write("You came to unknown domain. Please choose one of the
following:<br>")
response.Write("<a
href='http://www.xxxx.com>http://www.xxxx.com</a><br>")
response.Write("<a
href='http://www.yyyy.com'>http://www.yyyy.com</a><br>")
end if
%>