Reputation: 2346
I want to offer client.domain.com
for every client on the site. In practice, client.domain.com
is equivalent to www.domain.com/client/
(which I know how to handle in urls but isn't what I want).
Can I use django-subdomains
to allow this sort of wildcarding without defining SUBDOMAIN_URLCONFS
since I don't want to try and enumerate for all clients.
I'm currently using Apache. I don't want to create a new virtual host for each client as well. Is there a generic way to make client.mydomain.com
work?
Appreciate all pointers to executing #1 and #2. Thanks.
Upvotes: 1
Views: 607
Reputation: 29967
You don't have to enumerate all clients, according to the example configuration in the docs, django-subdomains
will use the ROOT_URLCONF
when no entry in SUBDOMAIN_URLCONFS
matches.
I'm not very familiar with Apache, but you should be able to use a wildcard ServerAlias
:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias *.example.com
...
</VirtualHost>
Upvotes: 1