I'm trying to redirect my root domain to the www version using this code in .htaccess: RewriteCond %{HTTP_HOST} ^example\.com [NC]
301 redirect doesn't work?
4
I'm trying to redirect my root domain to the www version using this code in .htaccess:
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
(Of course I replaced example with my domain name!)
It worked for a few minutes and then stopped redirecting. I've tried several other versions of the redirect but nothing works.
The fact that it started out working tells me the code is correct but there must be something else conflicting with it.
I also tried to redirect my index.html page to the root domain with equal lack of success.
My .htaccess file has this pre-existing code and I wonder if anything here is causing the problem:
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName "control-your-blood-pressure.com"
AuthUserFile /users4/data/c/controly-07386/public_html/_vti_pvt/service.pwd
AuthGroupFile /users4/data/c/controly-07386/public_html/_vti_pvt/service.grp
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
(Of course I replaced example with my domain name!)
It worked for a few minutes and then stopped redirecting. I've tried several other versions of the redirect but nothing works.
The fact that it started out working tells me the code is correct but there must be something else conflicting with it.
I also tried to redirect my index.html page to the root domain with equal lack of success.
My .htaccess file has this pre-existing code and I wonder if anything here is causing the problem:
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName "control-your-blood-pressure.com"
AuthUserFile /users4/data/c/controly-07386/public_html/_vti_pvt/service.pwd
AuthGroupFile /users4/data/c/controly-07386/public_html/_vti_pvt/service.grp
- Mark Brian
- DavidO
- Mark Brian
Next Topics on Trending Feed
-
4