Jump to content

[solved] Non www. Links To www. Link Redirection 404 Error


Recommended Posts

Dear developers 

I've got a seo problem here ^_^

My website links set to be started with www. e.g www.mysite.com

but whenever I got users from google with none www. links e.g http://mysite.com/21-fitness

the link redirection became like this: http://mysite.com/21-fitness?controller=404 & google webmaster tools submite an error for my site, this affect my seo very badly as I stock at a low level rank :(

 

does some body here know how to correct this mess ?

I have to mention that I've already try this code in .htaccess but no result!

 

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

 

sorry for my bad english

Thanks in advance

Shervin.Kh

Link to comment
Share on other sites

Dear developers 

I've got a seo problem here ^_^

My website links set to be started with www. e.g www.mysite.com

but whenever I got users from google with none www. links e.g http://mysite.com/21-fitness

the link redirection became like this: http://mysite.com/21-fitness?controller=404 & google webmaster tools submite an error for my site, this affect my seo very badly as I stock at a low level rank :(

 

does some body here know how to correct this mess ?

I have to mention that I've already try this code in .htaccess but no result!

 

RewriteEngine On

RewriteCond %{HTTP_HOST} ^bazeh.com$

RewriteRule ^(.*)$ http://bazeh.com/$1 [L,R=301,QSA]

 

sorry for my bad english

Thanks in advance

Shervin.Kh

I like this for non-www to www.  I do not thing the one you posted is good for this.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]



			
		
  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...