Go Back   WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 06-05-2009, 04:59 AM   #1
Senior Warrior Member
War Room Member
 
DavidO's Avatar
 
Join Date: Mar 2006
Location: United Kingdom, Spain
Posts: 2,031
Thanks: 10
Thanked 101 Times in 58 Posts
Default 301 redirect doesn't work?

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
DavidO is offline   Reply With Quote
Old 06-05-2009, 05:22 AM   #2
Spartan Warrior
War Room Member
 
Join Date: Jul 2008
Location: PH
Posts: 903
Thanks: 122
Thanked 144 Times in 72 Posts
Default Re: 301 redirect doesn't work?

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


Mark Brian is offline   Reply With Quote
Old 06-05-2009, 05:26 AM   #3
Senior Warrior Member
War Room Member
 
DavidO's Avatar
 
Join Date: Mar 2006
Location: United Kingdom, Spain
Posts: 2,031
Thanks: 10
Thanked 101 Times in 58 Posts
Default Re: 301 redirect doesn't work?

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.
DavidO is offline   Reply With Quote
Old 06-05-2009, 05:30 AM   #4
Spartan Warrior
War Room Member
 
Join Date: Jul 2008
Location: PH
Posts: 903
Thanks: 122
Thanked 144 Times in 72 Posts
Default Re: 301 redirect doesn't work?

Hmm.. try adding this on top:

RewriteEngine On


Mark Brian is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum

Tags
301, redirect, work

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 06:48 AM.