Google ignoring htaccess? I'm shocked!

snowtgr

Newbie
Joined
Oct 1, 2010
Messages
28
Reaction score
1
I've created dozens of sites and never had a problem like this. I recently created a few new sites and I have a problem with one of them.

I use .htaccess to choose if I want www or not. Google always indexed the domain I chosen in htaccess (www or not www)

I always use this htaccess file

Code:
RewriteBase /
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain,net
RewriteRule ^(.*)$ ht tp://www,domain,net/$1 [R=permanent,L]

(used , instead of . in the code because BHW thinks I'm spamming...)

However this time google indexed domain.net version and it should index www version LOL. How is this even possible?
 
Did you build links to non-www?
In any case I would just wait, it will probably change along your configuration soon :)
 
You can also just add your website into google webmaster tool and specify you want the url to be displayed in google with www, that will definitely solve the issue!
 
I didn't build any links yet. I never had such a problem. I'm surprised why it indexed non-www (because I use htaccess redirection)

Maybe since new google algorithm changes the mighty google knows better if you need www or not ;D
 
You can also just add your website into google webmaster tool and specify you want the url to be displayed in google with www, that will definitely solve the issue!

I decided to stay away from unnecessary google tools like (webmaster tools, analytics). I'm a black hatter and I hate unnecessary google software like the devil hates holy water. This should work with htaccess and it always worked for me on dozens of sites.
 
Are you sure it works? I mean, typein your domain without www and see if it redirects to a www version. If you PM me your site url, I can have a look :)
 
Sure it works. It redirects to the www version

To be honest I place the correct htaccess file always immediately after buying a domain. Even a few seconds before I upload the website.
 
Did you check the header and does it show permanent redirect? I have doubt coz I use [R=301,L] and not [R=permanent,L]. I am not saying it's wrong but I don't know if it is right...

Sure it works. It redirects to the www version

To be honest I place the correct htaccess file always immediately after buying a domain. Even a few seconds before I upload the website.
 
Did you check the header and does it show permanent redirect? I have doubt coz I use [R=301,L] and not [R=permanent,L]. I am not saying it's wrong but I don't know if it is right...


[R=301,L] as well as [R=permanent,L] are correct.


It's the same thing

Source ht tp://www,webmasterworld,com/forum92/1404.htm
 
Two possiblities...

a) There was a site previously on this domain without www.
b) There are links going to it without the www.

Whether you like it or not, the only easy fix is adding the site in webmaster tools and selecting to show search results with www.
 
Two possiblities...

a) There was a site previously on this domain without www.
b) There are links going to it without the www.

Whether you like it or not, the only easy fix is adding the site in webmaster tools and selecting to show search results with www.


Crashed great answer :) I bought a domain with history (expired in March 2013) and the site that was there was probably non-www. However I was not sure if this could be the reason.

The domain was not indexed (checked using site: ) in google before I uploaded my site. I thought that google will read the new htaccess.

Is there a way to check if a domain was using www or not in past? It wasn't in waybackmachine, and it had no backlink profile.
 
Last edited:
Back
Top