I just realized I was using this to redirect non-www to www.
It works, but shouldn't this be the proper way?
Reason I ask is a newer domain I'm running still shows both www and non www in Google and it uses the 1st format. It does redirect properly so I dunno, what the heck is the difference if any? I know Goog takes a while to get it right but just sayin.
Code:
RewriteCond %{HTTP_HOST} !^www\.url\.com$ [NC]
RewriteRule ^(.*)$ http://www.url.com/$1 [R=301,L]
It works, but shouldn't this be the proper way?
Code:
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Reason I ask is a newer domain I'm running still shows both www and non www in Google and it uses the 1st format. It does redirect properly so I dunno, what the heck is the difference if any? I know Goog takes a while to get it right but just sayin.