How can I make a virtual host accept multiple domains?

29,758

Yes. Use the ServerAlias directive alongside the ServerName directive.

Share:
29,758

Related videos on Youtube

agente_secreto
Author by

agente_secreto

Updated on January 05, 2020

Comments

  • agente_secreto
    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
      SaidbakR almost 8 years
      Setting configurations of the Apache web server is related to programming. This question should be reopened.
  • agente_secreto
    agente_secreto about 14 years
    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?
  • skaffman
    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
    user208145 about 7 years
    This made it so I was able to use www.example.org and example.org in a browser. Thank you.