How can I prevent indexing of site without "www"

  • kingdean2
  • Born
  • Born
  • kingdean2
  • Posts: 1

Post 3+ Months Ago

I read this thread and I have some additional questions for anyone that can help.
http://www.ozzu.com/other-google-information-and-resources/how-can-prevent-indexing-site-without-www-t1485.html


My question is after using the following code on my site, anytime someone types in http://mysite.com it does actually work and go to http://www.mysite.com/ (I put my actual site name in the code)

ErrorDocument 301
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com$
RewriteRule ^(.+) http://www.mysite.com/$1 [L,R=301]


But the problem is in my error logs. This is what is the error says. I have changed the IP address to 0.0.0.0

[Tue Oct 5 23:51:26 2004] [error] [client 0.0.0.0] Invalid error redirection directive:

Does anyone know what the error could be?

Thanks
Dean
  • implix
  • Novice
  • Novice
  • implix
  • Posts: 22
  • Loc: Poland

Post 3+ Months Ago

Try changing your rewrite rule to:

RewriteRule ^/(.*)$ http://www.mysite.com/$1 [L,R=301]
  • alien
  • Novice
  • Novice
  • alien
  • Posts: 30

Post 3+ Months Ago

Paste the code in the .htaccess file as it is. You do not have to change anything.
Quote:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\..* [NC]
RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301]
  • TheArchitect
  • Professor
  • Professor
  • TheArchitect
  • Posts: 764
  • Loc: Australia

Post 3+ Months Ago

Alien, are both those sites in your signature yours? :?:
  • alien
  • Novice
  • Novice
  • alien
  • Posts: 30

Post 3+ Months Ago

Yes.
  • TheArchitect
  • Professor
  • Professor
  • TheArchitect
  • Posts: 764
  • Loc: Australia

Post 3+ Months Ago

I really like the PageRank site. :wink:

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.