3 replies
  • SEO
  • |
I have a 2 year old site that DOES NOT redirect the "www" or "non www" to the same destination. So I created a .htaccess and uploaded to the root directory. The site did not display and was giving some redirect errors.

Is this .htaccess thing really necessary?

Thanks

Sam
#htaccess
  • Profile picture of the author shaktimaan
    Try this code

    to redirect non www to www


    Options +FollowSymLinks
    RewriteEngine On
    #
    RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

    to redirect www to non www

    Options +FollowSymLinks
    RewriteEngine On
    #
    RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC]
    RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301]
    Signature

    Shaktimaan

    {{ DiscussionBoard.errors[2403675].message }}
  • Profile picture of the author samcarson
    Thanks Shaktimaan for your reply.

    Is this really needed? The issue I have is, I purchased this site and half the backlinks were built by earlier owner who used "www" and I have been building backlinks without www.

    Sam
    Signature
    {{ DiscussionBoard.errors[2403842].message }}

Trending Topics