On my old host, when adding a domain i could choose if i wanted http://www.domain
, http://domain
, or both (if for example i chose www.domain, it would redirect http://domai
n to http://www.com
.)
is this possible without editing .htaccess? like in vosts.conf?
also, if doing it via .htaccess, what is the best method?
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
? i've read that without the first line, http/1.0 browsers will fail (as they don't include the host in the header)