w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Apache 2.4 Wildcard Subdomain Virtual Host

I think the configuration you are looking for it's quite similar to this one:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName example.com
  ServerAlias www.example.com
  DocumentRoot /var/www/example/public_html

<VirtualHost *:80>
  ServerName *.example.com
  ServerAlias *.example.com
  DocumentRoot /var/www/wildcardexample/public_html

What to you think? In this case, any subdomain will be redirected to the same site. Is this the configuration you want? Or you want different configurations for each subdomain?

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.