Wildcard Domains
A wildcard domain (*.example.com) catches all subdomains that are not explicitly defined. If someone visits anything.example.com and that subdomain has no dedicated record, the request is handled by the wildcard rule.
When to use wildcard domains
- Multi-tenant applications – each customer has their own subdomain (e.g.,
company1.example.com,company2.example.com) - Dynamic subdomains – subdomains generated by the application at runtime
- Catch-all landing pages – capturing any non-existent subdomains
Enabling wildcard domains
- Log in to the user panel
- Go to your domain settings
- Toggle Wildcard Enabled on
DNS setup
Add the following to your domain's DNS records:
*.example.com A SERVER_IP_ADDRESS
Alternatively, you can use a CNAME record:
*.example.com CNAME example.com
SSL certificate for wildcard
For wildcard domains, you need a wildcard SSL certificate (*.example.com). You can request this certificate from the SSL Certificates page in the panel. A wildcard certificate covers all first-level subdomains.
Application-level handling
Your application must handle routing based on the subdomain. For example:
// PHP – detecting the current subdomain
$host = $_SERVER['HTTP_HOST'];
$subdomain = explode('.', $host)[0];
Laravel – subdomain routing
Route::domain('{tenant}.example.com')
->group(function () {
Route::get('/', function ($tenant) {
// Logic for specific tenant
});
});
Framework compatibility
- Laravel – native support via subdomain routing
- WordPress – multisite mode with subdomain mapping
- Other frameworks – handling via the
HTTP_HOSTheader
Important note
A wildcard domain only catches subdomains that do not have their own explicit DNS record. If you have a defined subdomain blog.example.com, it will take priority over the wildcard rule.
Was this article helpful?
Your feedback helps us improve our documentation