473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

2 Domains go to one Website - How to redirect one?

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.
Jul 20 '05 #1
3 5342

"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
%>
Jul 20 '05 #2
What do I put in where you wrote "SERVER_NAME" below? or do I just leave it exactly like that? If
not, do I just put in www.xxxx.com or something else?
On Tue, 30 Sep 2003 17:22:40 -0400, "Matt Herson" <eb***@mherson.com> wrote:

"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
%>


Jul 20 '05 #3
You don't need to redirect the second domain, you can you pointed ou parked
domains
regards
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: d.schulz81 | last post by:
Hi all, We have about 10 different domains that are linked very closely and we want to identify and keep track of every single user that surfs our websites by the use of sessions. The problem...
7
by: | last post by:
I think I may have a problem with the user of cookies in my centralized logon and registration system that I hoped could be consumed by all the sub-domains on my remote host IP. I built the...
13
by: Craig | last post by:
Hey all, Here's the situation: - two websites, one on domain1 and the other on domain2 - domain1 opens a new window which is a javascript app from domain2 - domain1 needs to communicate with...
7
by: Seth | last post by:
I have noticed that the id of my session object changes when I switch from a non-secure to a secure connection. What I'm trying to do: I have a cookie that is built on the non-secure side of...
6
by: Ludvig | last post by:
I have various domains using the same application/assembly They differ in contents and design, based on a "site id", and get its information from an SQL server. Now I have to deploy the...
2
by: Pete | last post by:
I'm writing a web site for a friend. The site is going to have to consist of two ASP.NET applications: one running over HTTP and one over HTTPS. The problem is that the domains will be different,...
5
by: Tyler | last post by:
I am developing an application which will allow me to automatically sign into an external website. I can currently do a screen scrape using HTTPWEBREQUEST. However I want to just redirect to the...
1
by: tanya.wang | last post by:
Hi all, We have a site called http://www.mydomainxyz.com/ and our network guy has set up load balancing with multiple IIS servers. We also have a function that allows users to upload photos on...
1
by: Gustaf | last post by:
I'm part of an organization with activities in Sweden, Norway and Denmark. Some activities are local to each country, while others are common. Now we want a website to inform the members and public....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.