svlug-redirecting_virtual_host_with_apache_1.3

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Date: Fri, 25 Oct 2002 20:42:15 -0700
From: Vince Hoang <svlug@az0.altern8.net>
To: SVLUG <svlug@lists.svlug.org>
Subject: Re: [svlug] Apache 1.3 and redirecting a virtual domain to a web

On Thu, Oct 24, 2002 at 10:43:17PM -0700, Daevid Vincent wrote:
> I've tried to use:
> RedirectPermanent http://mp3.daevid.com         http://daevid.com/mp3
> RedirectPermanent http://resume.daevid.com
> http://daevid.com/resume.shtml

The syntax appears to map a path to an URL, not an URL to an URL.
Here are examples from the Apache docs:
    Redirect /service http://foo2.bar.com/service
    Redirect permanent /one http://example.com/two
    Redirect 303 /two http://example.com/other

You might want to experiment with mod_rewrite in your default
virtual host. I am used to rewriting from paths with mod_rewrite,
but not the actual HTTP_POST. The following rule will not work,
but it may get you closer to what you want to do.

  RewriteRule ^([^.]+)\.daevid\.com(.*) http://daevid.com/$1$2 [L,R]

My last suggestion is to have a script in your default virtual
host redirect you to the proper path. This could be simple CGI
script or full blown handler.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu