I have been trying to set up a 301 redirect and it is being a pain in my ass. I have been using the following code in the .htaccess file but to no avail.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
I have also logged in to DirectAdmin and inputted the 301 redirect in the control panel there, but still not working.
Every time I visit mysite.com I just get the message "Apache is functioning normally", instead of it redirecting to www. mysite.com
I am sure there is some little thing I am missing, but I can't figure it out. Is it a server problem and not a code problem? I have never had any trouble like this with 301 redirects before.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
I have also logged in to DirectAdmin and inputted the 301 redirect in the control panel there, but still not working.
Every time I visit mysite.com I just get the message "Apache is functioning normally", instead of it redirecting to www. mysite.com
I am sure there is some little thing I am missing, but I can't figure it out. Is it a server problem and not a code problem? I have never had any trouble like this with 301 redirects before.