Actually on second thought, the rewrite rule in the first host should be
like this to avoid loop:

       RewriteEngine On
       RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [OR]
       RewriteCond %{HTTP_HOST} !^mydomain\.com
       RewriteRule     .* http://www.mydomain.com%{REQUEST_URI} [L,R=301]

Cheers,
Igor

On Thu, Jun 2, 2011 at 9:59 AM, Igor Cicimov <icici...@gmail.com> wrote:

> Change the order of the hosts since the first one matches first.
>
> Igor
>
>
> On Thu, Jun 2, 2011 at 9:48 AM, Geoff Millikan <gmilli...@t1shopper.com>wrote:
>
>> > Try making the first one _default_ host
>> > <VirtualHost _default_:80>
>>
>> Thanks but since we're doing name-based virtual hosting I don't believe
>> that will apply to us because the manual says the _default_
>> setting only applies to IP virtual hosting but let me know if you have
>> thoughts otherwise!
>>
>> "The string _default_ is used only with IP virtual hosting to catch
>> unmatched IP addresses." -
>> http://httpd.apache.org/docs/current/mod/core.html#virtualhost
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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-unsubscr...@httpd.apache.org
>>   "   from the digest: users-digest-unsubscr...@httpd.apache.org
>> For additional commands, e-mail: users-h...@httpd.apache.org
>>
>>
>

Reply via email to