This should be a very simple question to answer.
How would I setup a .htaccess file to send visitors from mydomain.com to www.mydomain.com?
I just had some Ajax headaches caused by the same-source rule, and this should be an easy way around it.
This should be a very simple question to answer.
How would I setup a .htaccess file to send visitors from mydomain.com to www.mydomain.com?
I just had some Ajax headaches caused by the same-source rule, and this should be an easy way around it.
Don't do that. Doing reverse makes sense. See http://no-www.org/
But to answer:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^host.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.host.com$
RewriteRule ^/?$ "http\:\/\/www\.host\.com\/" [R=301,L]