[HCoop-Help] Domtool redirect: with www to without www keeping file path

Adam Chlipala adamc at hcoop.net
Thu Apr 9 12:37:06 EDT 2009


Davor Ocelic wrote:
> On Thu, 9 Apr 2009 17:12:16 +0100
> Michal <michalcharemza at gmail.com> wrote:
>
>   
>> Ok... I spoke too soon. It seems to work at first, but now I get a
>> 'too many redirects' error.
>>     
>
> If I was following your previous mails correctly, my guess is
> that visiting
>
> www.yoursite
>
> works like expected, but then your regex rewrite rule is written
> in a way that it rewrites both www.yoursite and yoursite.
>
> So what happens is a loop like this:
>
> www.yoursite -> yoursite -> yoursite -> yoursite...
>
> You need to improve 
>
> rewriteRule "^(.*)$" "http://mydomain.com$1"
>   

Even better would be to configure your domain with [CreateWWW = false] 
and to use [vhostDefault] like I said.  Examples of both are found at:
    http://wiki.hcoop.net/DomTool/Examples

P.S.: Every time I have to write an example, I get a little irate, 
because Domtool has a type system, such that the type of each directive 
tells you exactly how you can use it.  If you want to save everyone some 
time, you can read the Domtool docs further to learn to read types.



More information about the HCoop-Help mailing list