0

I have a web site with .htacess file looks like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^wendabang.com$ [NC]
RewriteCond %{HTTP_HOST} !^www.wendabang.com$ [NC]
RewriteRule ^(.*)$ http://www.wendabang.com/$1 [L,R=301]

This morning when I was checking Google web master tool I fond in the back link section Google listed wendabang.com as a site has links back to www.wendabang.com site. I think this issue should be rested in my .htacess file. But I can not spot the issue.

Another shameless question what I should do if I want to redirect http://www.wendabang.com/ and www.wendabang.com to wendabang.com, I think ditching http:// and www is nice. Thank you in advance.

1 Answers1

0

the site has multiple issues

the http://www.wendebang.com/ redirects HTTP 302 temp. redirect to http://wendebang.com/. a HTTP 302 comunicate the start url to google as the right url. this means you tell google to see http://www.wendebang.com/ as the url it should display to its users.

additionally, inside your HTML you have

<link rel="canonical" href="http://www.wendabang.com">

and your links look like this

<a href="http://www.wendabang.com/web-analytics-beautiful-shortcomings.html"

as the canonical tag is treated by google like an HTTP 301 permanent redirect you are google again redirecting to the www version.

and a lot of the links point to the www version as well.

at this stage i believe it is a only due to google magnificent error handling that your site is still indexed by google.

1) please see this answer to see about the right way to da an www to non www redirect via .htaccess. Generic htaccess redirect www to non-www

2) change your canonical tags to non www urls

3) change your internal links to non www urls.

and http is a protocol, you can not ditch it (said that, you could ditch is and invent your own protocol on top of the tcp/ip layer, but that is probably not what you want)

Community
  • 1
  • 1
Franz Enzenhofer
  • 3,666
  • 5
  • 19
  • 30