Remove WWW in URL through htaccess

I always want to have my website url remove the www in the address so I can have shorter address displayed in the address bar on a web browser and at the same time save keystrokes in typing a URL. Example, I have the website I will just want to have instead. Just insert the code below in your .htaccess file and you will be able to remove the obvious www in every website address.
RewriteEngine On 
RewriteCond %{HTTP_HOST} !^$ [NC] 
RewriteRule ^(.*)$$1 [L,R=301]

No comments:

Post a Comment