Thanks to kingsol, I got the answer. I was missing the terminator ($) on my 
condition regex. It should have been:

RewriteCond %{HTTP_HOST} ^example\.com$ [NC]


On 17 Jan 2011, at 9:46, Wade Preston Shearer wrote:

> I am redirecting "example.com" to "www.example.com." Strangely, it works for 
> "example.com/" but not for "example.com" on one of my servers. The later 
> produces an infinite redirection loop. The exact same redirection rule works 
> on other servers of the same configuration though. Any ideas?
> 
> Note: I have tried several common methods for redirection (separate 
> virthalhost, mod_rewrite, and mod_alias) and get the same results.
> 
> 
> Here is the rule for my current method (mod_rewrite):
> 
> RewriteCond %{HTTP_HOST} ^example\.com [NC]
> RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
> 
> 
> Again, this works on other servers so I don't think that it's an issue with 
> the rewrite rule. I don't have control over the DNS for this particular 
> domain. Could it be an issue with that?
> 
> _______________________________________________
> 
> UPHPU mailing list
> [email protected]
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net


_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to