![]() | | ||||||||
| | #1 |
| Senior Warrior Member War Room Member Join Date: Mar 2006 Location: United Kingdom, Spain
Posts: 2,031
Thanks: 10
Thanked 101 Times in 58 Posts
|
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 |
| | |
| | #2 |
| Spartan Warrior War Room Member Join Date: Jul 2008 Location: PH
Posts: 903
Thanks: 122
Thanked 144 Times in 72 Posts
|
The pre-existing code is usually for Frontpage extensions that are not generally used. Try removing it and just leave your code but back it up just in case things go wrong. It should not cause any problems without it if you're not using Frontpage extensions |
| | |
| | |
| | #3 |
| Senior Warrior Member War Room Member Join Date: Mar 2006 Location: United Kingdom, Spain
Posts: 2,031
Thanks: 10
Thanked 101 Times in 58 Posts
|
Thanks, Mark. I already tested it with only the redirect code and no luck. I've confirmed that I'm on a Linux/Unix server too. I've checked the redirect code from serveral sources and it's got to be correct. |
| | |
| | #4 |
| Spartan Warrior War Room Member Join Date: Jul 2008 Location: PH
Posts: 903
Thanks: 122
Thanked 144 Times in 72 Posts
|
Hmm.. try adding this on top: RewriteEngine On |
| | |
| | |
![]() |
|
| Tags |
| 301, redirect, work |
| Thread Tools | |
| |
![]() |