httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <>
Subject Re: [users@httpd] .htaccess redirect issue
Date Thu, 27 May 2010 09:03:30 GMT
On Thu, May 27, 2010 at 9:50 AM, J. Bakshi <> wrote:
> On 05/27/2010 01:59 PM, Nilesh Govindarajan wrote:
>> I assume that you want to redirect to
>> Considering that scenario and limiting subdomains only to
>>, the following rule works (I've tested them on my
>> server):
>> RewriteEngine On
>> RewriteCond %{HTTP_HOST} (.+)$
>> RewriteRule (.*){HTTP_HOST}
> Ok, but is it possible to extend these rule sets so that It can also
> work with other domains too ? Say by using any variable in RewriteCond
> which can hold the requested domain name and delivered it in the
> RewriteRule
> Please let me know if it is possible.
> Thanks

No offence meant here, but I see you posting here all the time. This
information is clearly explained in the apache manual, perhaps you may
need to give it another glance, specifically at backreferences?

RewriteCond %{HTTP_HOST} (.+)
RewriteRule .* http://foo/?domain=%1



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message