Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Sep 10, 2014 9:14 pm 
Offline
Newbie

Joined: Wed Sep 10, 2014 9:04 pm
Posts: 2
Hi,

I have both a .com and a .net domain name. The main domain is the .com but I'd like anyone typing the .net name to reach the same website.

I have set up a second domain zone for the .net address and the A record is pointing to the server's ip.
I'm running apache on debian.
Would I need to create a second virtual host file that points to the .com public space to get this to work? I've tried but to no avail.

What's the best way to go about this?

Cheers!


Top
   
PostPosted: Wed Sep 10, 2014 10:04 pm 
Offline
Newbie

Joined: Wed Sep 10, 2014 9:04 pm
Posts: 2
Ah nevermind, Apache hadn't restarted correctly.

The only thing now is that I want the .net to forward/change to the .com when loaded.
What's the best way to do this? (Is there a better way than using an htaccess file?)

Thanks again :)


Top
   
PostPosted: Wed Sep 10, 2014 10:06 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
No need for a second virtual host; just add a ServerAlias directive to the existing virtual host
eg
Code:
<VirtualHost *:80>
  ServerName www.example.com
  ServerAlias www.example.net
  ServerAlias www.example.org

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


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


Who is online

Users browsing this forum: No registered users and 2 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:  
RSS

Powered by phpBB® Forum Software © phpBB Group