How to hide (www.) from url? Is it helpful for blogging?

Discussion in 'Blogging' started by z2a, Mar 12, 2013.

  1. #1
    Please visit this 2 website.....
    www.socialh.com
    stackoverflow.com
    Have you see any difference on URL among them.

    The first website started with www. and the second website is without www. when you are browsing on browser.
    So how I can hide this www. part from browser?
    I mean when anyone will visit my website then he will see my website without www. part on browser.
    Thanks:)
     
    z2a, Mar 12, 2013 IP
  2. istiakrayhan

    istiakrayhan Active Member

    Messages:
    45
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    You can do this by adding a snippet in your .htaccess file.
    Add this code :


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


    Always backup your .htaccess file before editing.
     
    istiakrayhan, Mar 16, 2013 IP