Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Feb 25, 2011 4:35 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Hi guys, how can i access my site not only by "www.mysite.com", but "mysite.com" too?

Thanks


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 5:08 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Create a DNS record with nothing in the hostname field identical to the one you created with "www" in the hostname field, then tell your web server that it is an alias for your existing site.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 5:12 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Do i have to create another DNS zone or edit/add the one i have already?


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 5:35 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Edit the zone you already have. Just add another A record.

Also, edit your web server's configuration file and add the bare domain as an alias to your virtual host.


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 11:58 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Thanks hybinet, but can you explain how do i edit my web server's configuration file and add the bare domain as an alias to my virtual host?

* i already have an A Record for my domain without the "www".
Sorry, learnig here.
Thanks


Top
   
 Post subject:
PostPosted: Sat Feb 26, 2011 12:58 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
For apache in the virtual host file for your site where it says "ServerName" put a new line under it saying "ServerAlias" with the domain without the www i.e.


<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com
DocumentRoot /home/domain.com/public_html
</VirtualHost>

Then restart apache

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 3:27 am 
Offline
Newbie

Joined: Tue Apr 12, 2011 3:17 am
Posts: 3
You have to add another A record having host name as www.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group