46

I have two different domains I want to use for this website, how can I configure the virtual host to make this work?

Is it possible to assign it more than one server name?

Carrie Kendall
  • 11,124
  • 5
  • 61
  • 81
agente_secreto
  • 7,959
  • 16
  • 57
  • 83
  • 1
    Setting configurations of the Apache web server is related to programming. This question should be reopened. – SaidbakR Jul 28 '16 at 15:55

1 Answers1

61

Yes. Use the ServerAlias directive alongside the ServerName directive.

skaffman
  • 398,947
  • 96
  • 818
  • 769
  • Great, thank you! For some reason i thought server alias only worked for local connections. Can I use several server aliases in a single server alias line? If so, do I have to separate them by comas or just spaces? – agente_secreto Apr 30 '10 at 13:57
  • 12
    @oalo: Yes, you can string together as many space-separated values as you like. Alternatively, you can have multiple `ServerAlias` lines. – skaffman Apr 30 '10 at 14:24
  • This made it so I was able to use www.example.org and example.org in a browser. Thank you. – user208145 May 10 '17 at 08:17