Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Domain forwarding - how to get url of destination

Status
Not open for further replies.

theomen

Programmer
Jun 2, 2004
158
GB
Hi All,

I've developed a website for a client who has multiple domains. When a visitor goes to each of these domains, the colour scheme, logo etc. of the website will depend on which domain the visitor goes to.

The main domain is hosted with Demon, who have just changed the IP address the domain points to to the ip address of my web server. I've then set this up in IIS as a new website. All the other domains are registered with another registrar, and these are being forwarded using frames to the main domain, I then have all of these domains setup as additional headers to the main domain in IIS.

The problem I have is that although the domain in the address bar is showing as the forwarding domain, when I try to detect the domain it comes up with the domain its forwarded to.

The only way I have found so far to get the original domain is to get the referer url in asp.net using Request.ServerVariables. However, this isn't ideal, especially as if the session times out and they then go to a different page, it will probably use the main domain as the referer, so from then on they will be on the main domain instead of the forwarding domain, if this makes any sense at all.

My question is, how can I get the url of the frame I am in. From my google search it seems it may not be possible if the domain of the parent is different to that of the frame, but I just wanted to confirm this before I go much further on alternative methods.

I'd be grateful for any assistance.

Thanks in advance.
 
[tt]window.location[/tt] will always return the location of the frame you are in - as in the frame that is running the script.

Why not just set up the server-side forwarding properly and save yourself the trouble?

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Webflo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top