Linode Forum
https://forum.linode.com/

Point a second domain name at the same website.
https://forum.linode.com/viewtopic.php?f=19&t=11299
Page 1 of 1

Author:  muzzwood [ Wed Sep 10, 2014 9:14 pm ]
Post subject:  Point a second domain name at the same website.

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!

Author:  muzzwood [ Wed Sep 10, 2014 10:04 pm ]
Post subject:  Re: Point a second domain name at the same website.

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 :)

Author:  sweh [ Wed Sep 10, 2014 10:06 pm ]
Post subject:  Re: Point a second domain name at the same website.

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

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/