mod_rewrite capturing hostname?

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) ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-13-2005
Ivan Voras
 
Posts: n/a
Default mod_rewrite capturing hostname?

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


  #2 (permalink)  
Old 07-21-2005
Mads Toftum
 
Posts: n/a
Default Re: mod_rewrite capturing hostname?

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:09 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0