Enforce Browser To Add WWW Before Your Website

Why to have WWW before your Domain Name


Its very important in the eyes of Search Engine Optimization to render your website with a www in the beginning. If your site is being rendered with a www and also without a www then there is a big problem.

To overcome this issue lets find out a solution.

Adding WWW before Your Domain Name through .htaccess File


lets consider your website's name is "www.tapankumar.in" , So when you type www.tapankumar.in in the browser then it will open the site. Again if you type tapankumar.in in the browser then also it will open the site.



Now the problem is that when a search engine like Google try to crawl your site it will find TWO - 200 response against "www.tapankumar.in" and "tapankumar.in" ,  Hence the search engine consider this as a duplicate url.
You need to resolve this issue in order to get better SEO results, and here is a way to do this using your .htaccess file.
<IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteCond %{HTTP_HOST} !^www\.tapankumar\.in$ [NC]
     RewriteRule ^(.*)$ http://www.tapankumar.in/$1 [R=301,L]
  </IfModule>
Now put the above code into your .htaccess file, and this will prepend a "www" before your website address automatically. 


Happy Coding...

4 comments:

  1. Hello! I could have sworn I've been to this web site before
    but after looking at some of the articles I realized it's new to me.

    Regardless, I'm certainly pleased I found it and I'll be book-marking it and checking back often!

    Here is my homepage; tatuaże kielce

    ReplyDelete
  2. Hi to all, for the reason that I am really eager of reading this blog's post to be updated on a regular basis.
    It includes pleasant stuff.

    my page ... pure garcinia cambogia dr oz

    ReplyDelete
  3. Hello just wanted to give youu a quick heads up. The words in your article seem to bee running off the screen in Firefox.
    I'mnot sure if this is a format issue or something to do wwith browser compatibility but I figured I'd post to let you know.
    Thhe design and style look great though! Hope you get
    the isse fixed soon. Cheers

    Also visit my website; Asphalt 8 hack

    ReplyDelete
  4. Actually when someone doesn't know after that
    its up to other viewers that they will assist, so here it takes place.



    Here is my homepage - gas fireplaces Melbourne

    ReplyDelete