Click to See Complete Forum and Search --> : Domain Name needs www or else no display


prettyskin
03-21-2009, 07:59 PM
Am new to server administration, please help.

One of my domain name needs "www" in order for the browser to display the site. I made changes to the DNS Zone file. I am hosting two other sites on my Virtual Private Sever and they display without typing in "www" in the browser. The one that needs "www" is currently displaying one of the other sites on the VPS. Any help?

aj_nsc
03-21-2009, 09:45 PM
Create a .htaccess file in the root directory of the website that needs the www and add these lines:


Options +FollowSymlinks
RewriteEngine on

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


Obviously, replace yourdomain.com with your website url.

prettyskin
03-22-2009, 09:41 AM
aj nsc, thanks.
I created a .htaccess file in the root directory(where my index.html file is located) of the website with notepad and uploaded it. I still need to type in "www" in the browser to view my site. Any other help?:confused:

prettyskin
03-24-2009, 01:46 PM
:o
I called the file ".htaccess". Is this right? Who and what is reading this file so that I don't have to type in "www" in my browser.