[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] domain auto redirect -- AGAIN
- Subject: Re: [cobalt-users] domain auto redirect -- AGAIN
- From: Jeff Lasman <jblists@xxxxxxxxxxxxx>
- Date: Fri Mar 17 03:00:50 2000
- Organization: nobaloney.net
Tobe Johnson wrote:
> I would like to have several domains point to my server and automatically
> be forwarded to a specific site. I would prefer to do this without having
> to set up each individual domain with all the set-up stuff that occurs
> there.
>
> I wrote a script so that, when the 404 Not Found page is accessed, it will
> pull the host name from the URI, compare it to a MySQL database and then
> redirect depending upon the results. That part works fine.
This is absolutely the most complex method I've ever seen for
redirection <smile>.
What about simply using aliases (and of course, proper DNS)? Why make
life so complex? Do you enjoy complexity?
> The problem: I get an "unable to locate server" error message when I try
> to access a domain that is pointed to my servers (from network solutions),
> but is not yet set up on my servers.
There is no way in the world that Network Solutions, or any other
registrar, for that matter, points a domain to your server, so I really
don't think even you know what you're talking about.
What do you _think_ you're talking about? Please let me know so I can
continue trouble shooting this for you.
> I was hoping that it would hit the
> 404 page and then I could redirect it appropriately without setting it up
> on my servers, but unfortunately, that doesn't seem to be the case.
>
> Any comments/help would be appreciated.
> I tried setting up a PTR record
> for it,
Do you have any idea what the purpose is of pointer records? No? I
didn't think so. Pointer records are simply so someone (or some
machine) can look at an IP# and see who it belongs to. It hardly ever
actually points back to a specific site.
> but since I am using name based hosting, it takes the site to the
> first site in my list of sites for that particular IP Address....:-(
> Adding an A Record didn't seem to do the trick...
Please give me some concrete examples. What did you type into the
browser? What brand and version of browser? What does the zone file
for the domain have in it? To what nameservers do the root zone records
look? If you tell me exactly all of these things, I can do some tests
for you.
> >From the Users List - old postings:
> On Wed, 16 Feb 2000 12:16:12 -0800, Jeff Lasman wrote: >Of course with a
> database, HTML4, and the latest http, you could probably >send everything
> to one IP, parse the URL out of the http headers, then look >up the URL in
> a database, and use a PHP script to do something like I'm >doing, but on
> the fly.
> -----
> That is exactly how to do it - set up a single file (e.g. index.php3) which
> is also set to be the 404 page. When the request arrives, $HTTP_HOST will
> have the name of the server the user requested. At that point you could get
> as fancy as you want looking up the URL (e.g. multiple hostnames in domain,
> default for domain, etc) and finally do a Header("Location:
> $URL_for_domain").
I was talking about writing a simple "your domain is parked" page. This
technique could also be used for custom error pages. To use it for
redirection is overkill of the worst sort <smile>.
Jeff
--
Jeff Lasman <jblists@xxxxxxxxxxxxx>
nobaloney.net
P. O. Box 52672
Riverside, CA 92517
voice: (909) 787-8589 * fax: (909) 782-0205