I am trying to force http://mysite.com to go to http://www.mysite.com when someone tries to access my site by just typing in mysite.com.
I am using the code below to try to accomplish this but I get a "Internal Server Error". Any ideas?
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.mysite.com$
RewriteRule ^(.*)$ http://www.mysite.com/$1
.htaccess RewriteEngine
Moderator: General Moderators
I have found a solution in a Google search. This is a pretty useful piece of code.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.your-domain.com$
RewriteRule ^(.*)$ http://www.your-domain.com/$1 [R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.your-domain.com$
RewriteRule ^(.*)$ http://www.your-domain.com/$1 [R=301]