Web Server Website

With or Without WWW

Folks, some of you have might have a website. For example you develop (OF COURSE this is just an example :)). You might have a question, whether use (w/o “www”), or (w/ “www”). I don’t suggest that “www” is better, vice versa. But i’ll tell it about how to use with only, or without only.

The key is, you must create a .htaccess file in your root directory (or modify the old one if you’ve had it)

If you choose with www, use it in your .htaccess file

  RewriteEngine on

  RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  RewriteRule ^(.*)$$1 [L,R=301]