Andy Jarrett // Code. Develop. Manage.

Apache server alias wildcard

Something I've learnt recently that I might be the last to know but you can use wildcards (*) in the ServerAlias in Apache. In the past I've done something along the lines of

ServerName example.com ServerAlias www.example.com www.example.co.uk example.co.uk

Really all you need to do is:

ServerName example.com ServerAlias *.example.*

Hope this helps someone else


I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee.
Your support keeps this site running and the coffee brewing! ☕️