Hi All,
First, I apologize; it's likely this question has been asked a few times before, but I can't really figure out how to best search it.
The question is: what's the best practice for setting up your zone file and .htaccess to redirect URL's to a canonical URL?
Currently I have my Zone like so:
www.example.com CNAME IN 86400 example.com
example.com A IN 86400 000.000.000.000
And then in my .htaccess I've got:
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^(.*)$ "http://www.example.com/$1" [R=301,L]
While this is working, it got me to thinking: Am I making a loop here? Seems like i'm essentially telling a visiting browser:
1. Go to www.example.com
2. www.example.com is actually example.com
3. example.com points to www.example.com
So, thought I'd post here and see what the consensus is.