How can I make a virtual host accept multiple domains?
29,758
Yes. Use the ServerAlias
directive alongside the ServerName
directive.
Related videos on Youtube
Author by
agente_secreto
Updated on January 05, 2020Comments
-
agente_secreto over 4 years
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?
-
SaidbakR almost 8 yearsSetting configurations of the Apache web server is related to programming. This question should be reopened.
-
-
agente_secreto about 14 yearsGreat, 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?
-
skaffman about 14 years@oalo: Yes, you can string together as many space-separated values as you like. Alternatively, you can have multiple
ServerAlias
lines. -
user208145 about 7 yearsThis made it so I was able to use www.example.org and example.org in a browser. Thank you.