server redirects by client domain

server redirects by client domain

Post by Martin Hamilt » Fri, 15 Dec 1995 04:00:00



I was just wondering whether there are any HTTP servers out there
which let the server admin configure redirects based on the
client's domain name.  This seems like a neat way to make browsers
automatically use "nearby" mirror sites, without having to go
round tweaking all the clients.  Obviously it would only be useful
if you take the trouble to figure out the client's domain name

e.g. to re-direct accesses to everything at http://www.apache.org/
to an appropriate mirror site, you would want to put something like
this in your server config

  RedirectDomain / http://Bond.edu.au/External/Misc/apache/ .au .nz
    .jp .kr .cn
  RedirectDomain / http://iuinfo.tuwien.ac.at/apache/ .at .de .dk
  RedirectDomain / http://sunsite.mff.cuni.cz/web/apache/ .cz
  RedirectDomain / http://sunsite.icm.edu.pl/pub/www/apache/ .pl
  RedirectDomain / http://sunsite.doc.ic.ac.uk/packages/apache/ .uk
    .fr .be

(etc...!)

If nobody else is working on this sort of thing, I might have a
stab at hacking this into the NCSA and Apache servers

Cheerio,

Martin

 
 
 

server redirects by client domain

Post by John Fran » Fri, 15 Dec 1995 04:00:00



> I was just wondering whether there are any HTTP servers out there
> which let the server admin configure redirects based on the
> client's domain name.  This seems like a neat way to make browsers
> automatically use "nearby" mirror sites, without having to go
> round tweaking all the clients.  Obviously it would only be useful
> if you take the trouble to figure out the client's domain name

This has been a feature of the WN server for some time.  Here an
excerpt from the user's guide at <URL http://hopf.math.nwu.edu/docs/>

  "There is also a redirect command which can conditionally cause the
  server to send an HTTP redirect to a new URL.  For example if the text

  <!-- #if hostname =~ "\.uk$" -->
  <!--      #redirect = "UK_mirror_url" -->
  <!-- #endif -->

  is included at the beginning of an HTML document then any request from
  a UK host will automatically be redirected to the specified URL, the
  UK_mirror_url in this case.  This mechanism could also be used to
  redirect text only browsers to a text only alternative page, etc."

Of course lots of things besides hostname (e.g. user agent) can be
matched and the match is with any grep style regular expression.  Also
many things besides redirection can be done (e.g. include or exclude
some text).  If you consider the comment syntax to be SGML unfriendly
the alternate syntax

  <?WN #if hostname =~ "\.uk$" >
  <?WN      #redirect = "UK_mirror_url">
  <?WN #endif -->

works also.

--

John Franks     Dept of Math. Northwestern University


 
 
 

server redirects by client domain

Post by Barry Flanag » Tue, 19 Dec 1995 04:00:00


: I was just wondering whether there are any HTTP servers out there
: which let the server admin configure redirects based on the
: client's domain name.  This seems like a neat way to make browsers
: automatically use "nearby" mirror sites, without having to go
: round tweaking all the clients.  Obviously it would only be useful
: if you take the trouble to figure out the client's domain name

We do this using CGI - just check the REMOTE_HOST env variable and echo back
a "Location: " directive based on the host's location.

Hope this helps.

-Barry Flanagan
--
+------------------------------------ Galway -------------- Dublin-------+
|  IRELAND ON-LINE   |  VOICE  :  +353 (0)91 592727 | +353 (0)1 855-1739 |
| Dublin,Galway,Cork |  MODEM  :  +353 (0)91 569437 | +353 (0)1 662-4777 |
|  Limerick, Sligo   |  FAX    :  +353 (0)91 592726 | +353 (0)1 855-1740 |
+------------------------------------------------------------------------+

 
 
 

server redirects by client domain

Post by CyberGate Web Publishi » Fri, 22 Dec 1995 04:00:00


[snip]
: We do this using CGI - just check the REMOTE_HOST env variable and echo back
: a "Location: " directive based on the host's location.

That sounds like a great idea, but let me ask you a couple things:

1.  Do you have your root document point to a CGI?  I.e., do you have
    http://www.veryComputer.com/;If so, how?
2.  If you are using a redirect, do you redirect the document "/"?

RSK

--
..............................................................................
 <A HREF="http://www.*gate.com/*pub">                                
                                             * *Gate Web Publishing *    
                                                                         </A>
..............................................................................

 
 
 

server redirects by client domain

Post by Jake Donh » Sun, 24 Dec 1995 04:00:00



    RSK> 1.  Do you have your root document point to a CGI?  I.e., do
    RSK> you have http://iol.ie/ point to a CGI?  If so, how?  2.  If
    RSK> you are using a redirect, do you redirect the document "/"?

With Apache and NCSA httpd 1.5, you can specify more than one file in
the DirectoryIndex directive. See

http://www.apache.org/docs/mod_dir.html#directoryindex

Jake

 
 
 

server redirects by client domain

Post by Bonnie Sco » Fri, 29 Dec 1995 04:00:00



>  2.  If you are using a redirect, do you redirect the document "/"?

I had problems doing this with Netscape, but finally it worked.

I redirected /docroot/, and /docroot/index.html to /docroot/nonlocal.menu.
html.

What did NOT work with Netscape was setting up something like
<object ppath="/docroot/*">
..
<CLIENT = *~(requestors to shunt)>
..
path="index.html"
..
</CLIENT>
</OBJECT>

even if I had a separate entry with a path of just /docroot/.

Bonnie Scott

 
 
 

1. NIS+ Sub-Domain client: should it be a member of the master domain AND sub-domain?

Hello,

Our NIS+ sub-domain clients are still appearing as members of the
master domain. Is this correct? I thought when the sub-domain was
created the clients on it would no longer belong to the master domain.
This means sub-domain clients can be addressed as either
'machine1.subdomain.masterdomain.ac.uk' and
'machine1.masterdomain.ac.uk' which is not what we want.

TIA,

Matt

-=-=-=-=-=-=-= Remove *'s for my real E-Mail =-=-=-=-

2. Turtle Beach Montego

3. Apache Redirect/ReWrite for redirecting old->new domains?

4. Gnome Configuration files -Gnome 2

5. How to redirect to server mirror based on domain?

6. Unified IDE Patches

7. Redirecting sub domain to external server

8. Pine and smail

9. Windows client can't see NT domain when passing through a Linux PPP server

10. SQL II Client / Server for UNIX - Public Domain Available ??

11. Domain server client problem

12. AOL client fails with virtual domain HTTP servers?

13. Unix Domain Client and Server