Having www in URL of your webpages is not a necessary. It is matter of choice. Most of the internet users are still typing www in from of every domain they enter into they web browser. By use of apache's .htaccess file yuo can force your URL to contain www or you can remove www completely. Here is a way how to add www to your URL. Edit your .htaccess file:

Add www to URL

RewriteEngine On
RewriteCond %{HTTP_HOST} ^linuxconfig.org$
RewriteRule (.*) http://www.linuxconfig.org$1 [R=301]

Remove www from URL

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

In both cases replace domain name with your website's domain name.

When you are done make sure that you test both URL versions. Both of them should work but only one will be rewritten.

FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: