httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Vogel <samy-de...@gmx.de>
Subject Re: [users@httpd] Rewriting Subdomains to folders
Date Mon, 06 Aug 2007 21:41:52 GMT
Hey, this is my best guess:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+)\.samy\.newkilu\.de
RewriteRule ^/(.*)$  %1/$1 [L]

But somehow this doesn't do anything... What am I doing wrong?
I'm trying to rewrite "sub-sub"-domains to the appropriate folder.

Regards,
Samy

Joshua Slive schrieb:
> On 8/4/07, Samuel Vogel <samy-delux@gmx.de> wrote:
>   
>> I forgot to specify what i want/need.
>> I want to specifically know how the mod_rewrite solution works, because
>> I don't see how I can user the subdomain from RewriteCond in the
>> RewriteRule statement...
>>     
>
> This example shows one way to do it:
> http://httpd.apache.org/docs/2.2/vhosts/mass.html#homepages.rewrite
>
> In general, you use back-references to extract matches from
> RewriteCond's. The first match would be %1, the second %2, etc. See
> the RewriteRule docs.
>
> If you want more help, post your best guess at the correct config
> along with details on what you want it to do and what it is actually
> doing.
>
> Joshua.
>
> ---------------------------------------------------------------------
> 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
>   

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