473,698 Members | 2,503 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5359

"Mr B" <la*****@hahaha .com> wrote in message
news:ir******** *************** *********@4ax.c om...
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.ServerV ariables("SERVE R_NAME")
if inStr(1,serverN ame,"xxxx.com", 1)>0 then
response.Redire ct(www.xxxx.com/home.htm)
elseif inStr(1,serverN ame,yyyy.com,1) >0 then
response.Redire ct(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>ht tp://www.xxxx.com</a><br>")
response.Write( "<a
href='http://www.yyyy.com'>h ttp://www.yyyy.com</a><br>")
end if
%>
Jul 20 '05 #2
What do I put in where you wrote "SERVER_NAM E" 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.ServerV ariables("SERVE R_NAME")
if inStr(1,serverN ame,"xxxx.com", 1)>0 then
response.Redire ct(www.xxxx.com/home.htm)
elseif inStr(1,serverN ame,yyyy.com,1) >0 then
response.Redire ct(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>ht tp://www.xxxx.com</a><br>")
response.Write( "<a
href='http://www.yyyy.com'>h ttp://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
4470
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 is how to keep track of the session ID across domains. - cookies don't work because not acepted by 40 % of or users and cookies don't work across domains
7
2125
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 application in the root of the IP and redirect the user back to his requested page after his Login. Just before this I set a permanent cookie. But, it appears when the user gets back to the page its GONE.
13
4284
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 the javascript app on domain2 The problem occurs in that last step. Browsers don't allow script access across domains for security reasons, rightly so. Nonetheless, I still
7
3017
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 things. What I need to do is to switch to a secure connection and then later on while still in that secure connection delete the cookie that was created on the non- secure side. I need to do this because I can not reference the non-secure cookie...
6
4865
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 different "sites" to individual folders on the server, and set up the domains on IIS to point to these folders. If I do changes in the application, I have to deploy to all the different folders on the server.
2
1423
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, so how do I maintain state between the public area (http://www.mydomain.com) and the secure area (https://secure.myisp.com/mydomain)? What I'm trying to achieve here is for the site user to login to the site in the secure area, and then have a...
5
2436
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 external site. No need to pull back any data. Here is the code I am using. Dim encoding As ASCIIEncoding = New ASCIIEncoding Dim myParams As String = "AccessID=" & sUserID & "&Password=" & sPassword
1
3736
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 our website. Recently we found that doing load balancing will cause the upload function not workable sometimes and we came up with a plan by creating a specific domain (let's say http://upload.mydomainxyz.com/) and linking it to our primary web...
1
1763
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. We plan to register one domain for each country. The idea is that you'd get the same page regardless of which domain you're visiting. The pages could exist in different languages, and the user could be served his preferred language according to...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.