Solved

Change Home page depending on Domain

Posted on 2002-07-01
21
155 Views
Last Modified: 2013-12-25
Helping someone set up a website. Their outfitting business does hunting trips, Wilderness pack trips, and river fishing trips. They are considering multiple domain names to target each market. Could these all be set up on one site and have the home page be different based upon what domain they asked for. I think with frame forwarding the hunting domain could be pointed at a `hunting' page.

The reason I am asking is that almost all the content is identical. What we want to do is have the pack trip people see a home page that really emphasizes pack trips and have the hunting visitors see a home page that emphasizes hunting, etc. The rest of what the visitors see would be identical. They could be hosted separately but for ease of maintaining the site this would be simpler. The only problem I see is if you wanted to analyze traffic it is harder to tell what brought them to the site.

Suggestions/Comments appreciated
0
Comment
Question by:emery_k
  • 7
  • 5
  • 5
  • +1
21 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 7123530
>>these all be set up on one site and have the home page be different based upon what domain they asked for.


absolutely.


i forget all the steps, but i know this could be done using IIS and ASP.


What do you have available?
0
 
LVL 1

Author Comment

by:emery_k
ID: 7124470
They are going to be changing hosts. What do we need to make sure is on the server and what do we need on our side?

0
 
LVL 18

Expert Comment

by:bruno
ID: 7124490
Well, you could probably do it with most any server setup, but I'm only familiar with MS.....I'm sure someone else around here would be able to tell you how do it with a different setup....
0
 
LVL 11

Accepted Solution

by:
mouatts earned 50 total points
ID: 7132835
There are two basic ways of doing this. One is that you set up a primary domain and the domain pointers for the other domains and process the incoming request to determine which page you are using.

The second is to set up seperate domains that point to the same directories but use a different default document. Realistically with an ISP this will not normally be an option.

So to do the first one, and all servers can do this, youi default page needs to point to a script rather than a bit of plain HTML (eg ASP as Bruno suggested)

This script looks at the server variable HTTP_HOST which will contain the host name that the user requested ie wildernesstrips.com, fishingtrips.com or shootingdefencelessanimals_becauseimimpotent.com
It then either changes the output or redirects to the approriate page based on this.

From the ISPs point of view you will need them to set up the domain and the domain pointers but thats about it really.

HTH
Steve
0
 
LVL 1

Author Comment

by:emery_k
ID: 7132953
Steve
Thanks, that is a real clear explanation. I am checking with the ISP to see what the options are. The company (buydomains) that the names are registered with do either URL forwarding or Frame forwarding and one of those might work. I'm not real clear where the difference is between what they can set up and what is at the ISP. At this point we are doing a simple DNS entry to an IP address through them. Get back to you in a couple of days.
0
 
LVL 18

Assisted Solution

by:bruno
bruno earned 50 total points
ID: 7136101
emery,

I'd stay away from frame forwarding if you can, if simply to avoid bookmarking issues...


BRUNO
0
 
LVL 1

Author Comment

by:emery_k
ID: 7141924
Comments appreciated
I am researching this to make sure I understand it. It occurred to me if the site is www.outfitter.com and the fishing site (www.fishing.com) is set to go to www.outfitter.com/fishing.htm that works for when they first get to the site BUT if they go into the contact page then hit the home link that will take them to www.outfitter.com/home rather than going back to the fishing.htm page as the `home'. Am I correct and is there a way around this?
Thanks for the help
0
 
LVL 18

Expert Comment

by:bruno
ID: 7142109
well, i suppose you could set a session variable....mmm perhaps a cookie would work better, when you first come to the site, so at session_onstart, set a cookie saying which URL was used.

then, built the home link dynamically on each page, depending which URL was used to get there.


BRUNO
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7142230
emery:

Ignoring the problems I outlines earlier there are two possible ways in which this can be done and the method used effects the potential problem that you have seen.

Method 1 is to create seperate domains that simply point to the same area but to achieve what you want the home page of fishing.com would be set as fishing.htm. So a home (so long as you always used relative URLs) will always return to the correct place.

Method 2 is to create one domain then add fishing.com as a domain pointer. To get this to point to a particular home page you will need to place code/a script etc for the home page of outfiters.com so that if the incoming host name is fishing.com it redirects to fishing.htm. So long as you never want to see the outfitters home page within fishing.com this will continue to work (again so long as you use relative URLs). If you do want to see outfitter home page within fishing.com then all you would need to do is modify the script within the home page so that it directs to the correct home page for each site (ie the outfitters homepage would not be the default page for the domain but would appear as such due to the redirection.

HTH
Steve
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:emery_k
ID: 7143139
Steve
Now to study up on Relative URLs and domain pointers.
In some ways hosting them separately is simpler but more work for maintaining site. That would also be easier to analyze traffic. The comments from all are clarifying our options and appreciated.
0
 
LVL 1

Author Comment

by:emery_k
ID: 7143173
Bruno
Not ignoring your comment. Haven't used cookies before so researching that also.
It's challenging to learn and interesting to see the different approaches. Often the solution chosen here is probably the one the questioner is most comfortable with and not necessarily the best or most elegant. This is a great forum with some really great people.
0
 
LVL 1

Author Comment

by:emery_k
ID: 7143276
Bruno
Not ignoring your comment. Haven't used cookies before so researching that also.
It's challenging to learn and interesting to see the different approaches. Often the solution chosen here is probably the one the questioner is most comfortable with and not necessarily the best or most elegant. This is a great forum with some really great people.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7143483
emery,

that's fine, it's not even something I would be able to walk you through....I know a lot more of what is possible to do than I would actually know HOW to do myself...  ;-)


If you need help though, just say so I'll try my best.


BRUNO
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7143486
Emery
Having seperate domains doesn't have to mean more effort in maintaining them as the actual pages can be shared. Its just the configuration of each domain that will vary slightly.

Steve
0
 
LVL 1

Author Comment

by:emery_k
ID: 7143554
Steve
That is what we were hoping for. Since 90%+ of the content will be identical we're hoping to make it easy for the customer long term. That does mean doing the homework now to determine the best direction to go. And as Bruno said figuring out what can be done is the first step, then we have to determine how to actually do it.
There is some concern about knowing what hits are coming from where for what site but that is a secondary issue.
Now to crack the books on suggestions so far.

Emery
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7143702
If you are using seperate domains (ie seperate web servers) the stats will be held seperately for each site.

If using a domain pointer then the referer, where present will indicate which domain name was used. Thus in your case a hit to fishing.html from fishing.com will have either no referer or a referer that is not one of your domains. A hit on fishing.html from outfitters.com will have outfitters.com within the referer.

Incidentally an absolute URL is one that contains the domain name within it, and a relative URL is one that doesn't.

Normally you should use only relative URLs within a site. The only exception to this is when a redirection is needed then an absolute URL must be used. If using ASP this is handled dynamically so that you can use a relative URL and the server tacks on the relevent domain name. Within other environments you would normally need to construct the absolute URL from the server environment variables to keep the relative flavour of things.

Steve
0
 

Expert Comment

by:shaggz1222
ID: 7488943
You could probably do this with a Host Redirect Script

http://www.kastle.net/products/hostredirect/

Has one ....
0
 

Expert Comment

by:shaggz1222
ID: 7488949
Woops, I mean the URL Redirect Script:

http://www.kastle.net/products/URLredirect/


Description of this Perl Script:

 A extremely handy script that allows you to have multiple domain names registered to one (1) IP address and have them all redirected to a sub site of another. For example, you register search.your-domain.com, chat.your-domain.com and scripts.your-domain.com. Instead of having to use 3 extra IP's, you can redirect to your-domain.com/search, you-domain.com/chat.....


Hope that works for ya!
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7490876
Err shagz1222 thats kind of what has already been said, except that you shouldn't need to do multihoming via a script if you set the server up correctly.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now