This is a discussion on mod_rewrite capturing hostname? within the Linux Web Servers forums, part of the Web Server and Related Forums category; Is there a way to catch the hostname (or rather the intended hostname from the Host: HTTP/1.1 header) ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Is there a way to catch the hostname (or rather the intended hostname
from the Host: HTTP/1.1 header) in the rewrite rule? I'd like to do something like virtual hosts without actual virtual hosts, to rewrite urls like this: www.myserver1.com/something -> myinternalmachine/dir1/something www.myserver2.com/something -> myinternalmachine/dir2/something |
|
|||
|
On Wed, 13 Jul 2005 17:16:52 +0200, Ivan Voras <ivoras@fer.hr> wrote:
> Is there a way to catch the hostname (or rather the intended hostname > from the Host: HTTP/1.1 header) in the rewrite rule? > > I'd like to do something like virtual hosts without actual virtual > hosts, to rewrite urls like this: > > www.myserver1.com/something -> myinternalmachine/dir1/something > www.myserver2.com/something -> myinternalmachine/dir2/something > Sure - Read The Fine Manual: http://httpd.apache.org/docs-2.0/misc/rewriteguide.html Look at Virtual User Hosts - that should point you in the right direction. vh Mads Toftum -- Speaking at ApacheCon 2005/EU - http://apachecon.com |