How can I make a virtual host accept multiple domains? [closed]
Asked Answered
M

1

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?

Multiplier answered 30/4, 2010 at 13:25 Comment(1)
Setting configurations of the Apache web server is related to programming. This question should be reopened.Molal
A
61

Yes. Use the ServerAlias directive alongside the ServerName directive.

Anatole answered 30/4, 2010 at 13:30 Comment(3)
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?Multiplier
@oalo: Yes, you can string together as many space-separated values as you like. Alternatively, you can have multiple ServerAlias lines.Anatole
This made it so I was able to use www.example.org and example.org in a browser. Thank you.Tedder

© 2022 - 2024 — McMap. All rights reserved.