httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yakov Lerner <yakov.ler...@kavado.com>
Subject Re: [users@httpd] RewriteRule for subdomains (newbie)
Date Tue, 13 Jan 2004 17:33:16 GMT
Neil Freeman wrote:
> ...I would like to take a URL in the form:
> 
>     http://machine/site_name/
> 
> and have it rewritten to:
> 
>     http://site_name.machine
> 
> I have set up the appropriate VirtualHost for http://site_name.machine 
> and this works fine, it's just creating the appropriate RewriteRule 
> that's causing me a problem.

How about this (untested) :

     RewriteRule /([^/]*)/ http://$1.%{REMOTE_HOST} [P]

Regarding the [P] flag: leave it out if you need redirection, not proxying

-- 
Jacob Lerner


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message