tachyon has asked for the wisdom of the Perl Monks concerning the following question:

This post is a bit OT. I run a handful of virtual servers on Apache 1.3.27 using name based vitual hosts. Obviously these share a common ip. I would like clients to access webmain via http://webmail.client.domain.com rather than http://client.domain.com/cgi-bin/webmail. The first step of getting DNS to reslove the URL to the correct IP is eacy enough but then what is the best way to get Apache to redirect such requests to the desired location?

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

  • Comment on (OT) Directing webmail.somehost.com => smoehost.com/cgi-bin/webmail.pl using Apache

Replies are listed 'Best First'.
Re: (OT) Directing webmail.somehost.com => smoehost.com/cgi-bin/webmail.pl using Apache
by Tomte (Priest) on Feb 17, 2003 at 06:39 UTC
    ServerAlias and a RedirectRule?
    Untested and quickly written before I got my first coffee:
    <host xyz> ServerName client.domain.com ServerAlias webmail.client.domain.com RewriteEngine on RewriteCond %{HOST_NAME} ^webmail.client.domain.com$ RewriteRule ^/$ http://webmail.client.domain.com/cgi-bin/webmail [ +L,R] </host>
    I hope that helps to get you started.

    regards,
    tomte


    Edit:Added the [L,R] part
    Edit 2:AFAIK this works with http/1.1 Clients only, as http/1.0-clients don't send a Host-Header