AFP548 Changing the world one server at a time.

Wildcards in domains / Apache setup

Home › Forums › OS X Server and Client Discussion › Questions and Answers › Wildcards in domains / Apache setup

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #355046
    afriis
    Participant

    I have over 20 (and counting) domains running on our webserver (Server 10.1). I would like to be able to use wildcards in the domain names to allow both “domainname.com” and “www.domainname.com” without resorting to adding two posts to the sites list in the Server admin for each domain. I tested this out using both blanks and “*” without sucess. Any tips?

    #355117
    Admin
    Participant

    afriis wrote:

    I have over 20 (and counting) domains running on our webserver (Server 10.1). I would like to be able to use wildcards in the domain names to allow both “domainname.com” and “www.domainname.com” without resorting to adding two posts to the sites list in the Server admin for each domain. I tested this out using both blanks and “*” without sucess. Any tips?

    The simplest way to do this is to specify one name in Server Admin, and then edit httpd_macosxserver.conf to add the other name as a ServerAlias.

    For example, create the entry in Server Admin for “www.foobar.com” and then add

    ServerAlias foobar.com

    right after the ServerName line. Apple tried to discourage people from editing Apache configuration files in Server 10.1, but this small change won’t hurt Apache and will simplify your sites list in Server Admin.

    I think you might be able to achieve a similar effect by using wildcard DNS records, but am not certain. I know the directions above work, as I used them myself.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.