Tuesday, 10 October 2017 14:36

    How to create Redirect non-www to www using htaccess

    Written by
    Rate this item
    (1 Vote)

    Technically speaking, both www and non-www are 2 different websites and as such may be penalised by search engines for duplicated content. From an SEO perspective it is always best practice to redirect your non-www site URL to www or your wwww. to your non-www version.

    Our site www.accrodigital.com, for example, has a redirection from non-www (http://accrodigital.com) to www (http://www.accrodigital.com). In other, everytime anyone type http://accrodigital.com will be redirected to www.accrodigital.com. Note the "www" in the second URL.

    Technically, the non-www version and the www version are two different domains. So redirecting one to the other improves our SEO. Google and other search engines won't have to worry about two different domains.

    This tutorial will show you how to redirect your whole website to either non-www or www.

    Please note that you will need to find and access your htaccess file. It is located at the root of your website server.

    1. Locate the following line within your htaccess file

    RewriteEngine On

    2. To redirect non-www to www, add this code below it:

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

    3. To redirect www to non-www, add this code after RewriteEngine On:

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

    I hope that this tutorial will help you. Please leave your comment below if any.

    Read 1871 times Last modified on Wednesday, 11 October 2017 07:54
    Fabien Bello

    Fabien Bello has been working in web and app develoment since 1997. He has held numerous positions from game developer to head of creative and product development for major firms such as Xerox, Gala Coral Group. Fabien continues contributing to online community, owns and manages several websites as well as offering consultancy to all size businesses.

    5 comments

    • Comment Link ocean king ios Monday, 24 February 2020 07:26 posted by ocean king ios

      This is a must have. Your clients will respect you a lott more if you act and sound professional.
      And many people will take offence at being addressed too
      familiarly.

      It is actually very fun if someone from Silicon Valley were among the winners!
      If any area individuals or teams utilize one in the grants, tell us here at San Josee Fitness Examiner and we'll help market
      your entry.

      Just think of the power that even one person bag in order
      to be promote your online business. If are usually
      switching over to the NWPP - non-woven polypropylene - bag, tthen your bags become seen time and again again by othyer customers.
      What a great advertisement towards your business!
      You can bet that do not need to want to waste it.



      What is even much better than saving resources? Not spending any.
      Both Eversave and Coolsavings have areas where you can get frree stuff.

      These free offers can be anythging from soap samples to romance novels.
      Coild possibly send your other Omaha steaks and achieve
      a free platter for work for Mothering sunday. How wonderful is
      that? Free things!

      No matter wherfe you roam on a web, it should be your pursuit for lead
      customers back back to your site. as well as means doesn't just thee homepage, bbut other pages aas
      well. So drop those breadcrumbs in ordfer for
      folks you meet can follow the tfail to your blog site.
      Examples: include yur URL link in every blog and forum post you formulate.
      Broadcast your joker123 best slot to everyone yyou meet, and
      include the connectrion to a website that covers the deails in information. Your solee purpose in being online is to track back in the site, and today's cokntent distribution methods make it SO
      Simple do this skill! Trry it wih your articles, blogs, forum posts, reciprokcal links and lots more.


      The ladies date, the more dates show up bad, the longer she's alone and most popular versions
      she wants a gooid man in the life, ffar more desperate she becomes.
      Very few women caan handle camouflaging the following.
      In their gaze, in their kinds of speaking for you to some guy additionally their means of clinging, somewhere, somehow hat desperate little streak seeps in.

      When a visitor first visits your site, make sure you have how to capture his information. When you sell
      him a product, make sure you capture his email address as soon as more.
      Now he is your customer. He's part of your warm market andd can be far more valuable to you since you have sold
      tto him. http://www.oupjournals.com/__media__/js/netsoltrademark.php?d=crffy.xyz%2Fhome.php%3Fmod%3Dspace%26uid%3D7755%26do%3Dprofile%26from%3Dspace

    • Comment Link Wilbur Sunday, 23 February 2020 11:43 posted by Wilbur

      Hey very interesting blog! http://lin8888.com/home.php?mod=space&uid=443070&do=profile&from=space

    • Comment Link lpe88 login Thursday, 20 February 2020 22:07 posted by lpe88 login

      It was after a long tjme when he confided to Ramola that he or she liked womedn that smoked.

      Final Order - is actually why the time when several to take most
      warning. Merely grasping the writer's idea is insufficient. https://cebutouristvanrental.com/no-deposit-casinos-are-perfect-to-use/

    • Comment Link Is Valentines Day for couples Wednesday, 19 February 2020 15:37 posted by Is Valentines Day for couples

      I used to be recommended this web site via my
      cousin. I'm now not sure whether this put up is written by
      him as no one else understand such distinct approximately my difficulty.
      You are incredible! Thanks!

    • Comment Link What do the stages mean in the Daytona 500 Monday, 17 February 2020 19:23 posted by What do the stages mean in the Daytona 500

      Fantastic items from you, man. I have be aware your stuff prior to and you are just extremely fantastic.
      I really like what you've acquired here, certainly like what you are stating and the way in which in which you say
      it. You make it enjoyable and you still take care of to stay it wise.
      I can not wait to read far more from you. This
      is actually a tremendous web site.

    Leave a comment

    Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.