httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Rewriting Subdomains to folders
Date Thu, 09 Aug 2007 00:02:46 GMT
On 8/8/07, Samuel Vogel <samy-delux@gmx.de> wrote:
> This is how my vHost looks like now:
>
> <VirtualHost *>
>         ServerName samy.newkilu.de
>         ServerAlias *.samy.newkilu.de
>
>         DocumentRoot /data/apache/samy/www
>
>         RewriteEngine On
>         RewriteCond %{HTTP_HOST} !^www\.
>         RewriteCond %{HTTP_HOST} ^([^.]+)\.samy\.newkilu\.de
>         RewriteRule ^(.*)$  %1/$1 [L]
> </VirtualHost>
>
> All it gives me is "Bad Request". I don't understand this, since I got
> it to work in .htaccess with using " %{ENV:REDIRECT_STATUS} ="" ". What
> am I doing wrong in my vHost config?

You're rewriting to a path without a leading slash. Try
RewriteRule ^(.*)$  /%1/$1 [L]
Or try
RewriteRule ^(.*)$  /data/apache/samy/www/%1/$1 [L]

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