Category Archives: Apache

Tutorials on Apache

How to Ditch the WWW from Your Domain Name

Personally, I prefer to have http://domain-name.com rather than http://www.domain-name.com

In fact, unless you specify that they are the same site, Google can treat them as seperate Websites, and you would be diluting your page rank!

So:

Connect to your website via FTP. Find your .htaccess file (usually in your public_html/www folder). If you can’t find one, just open your text editor (notepad will do) and save it as “.htaccess”.

Find some clear space, and type the following:

RewriteEngine On
RewriteBase /

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

Simple? Yep!

Save & Upload! Sorted!

note: this is to UNIX-based machines only (UNIX is the most popular out there..)

Any questions just send me a direct message or leave a comment.

Share