Subdomain Setup
Setting Up Subdomains on BlitzPress
Subdomains (like blog.example.com or staging.example.com) are treated as separate sites on BlitzPress. Each gets its own vhost, SSL certificate, and optionally its own WordPress installation.
Step 1: Create DNS Record
Add an A record for the subdomain at your DNS provider:
| Type | Name | Value | TTL |
|---|---|---|---|
| A | blog | YOUR_SERVER_IP | 300 |
Verify it resolves:
dig +short blog.example.com
Step 2: Create the Site
On BlitzPress, a subdomain is just another site. Create it like any other:
blitzpress site:create blog.example.com
This creates the directory structure at /home/blog.example.com/, configures the OLS vhost, and sets up PHP.
Step 3: Install SSL
blitzpress ssl:install blog.example.com
Each subdomain needs its own SSL certificate. Let’s Encrypt treats subdomains as separate domains.
Step 4: Install WordPress (Optional)
blitzpress wp:install blog.example.com --title="My Blog" --admin_user=admin [email protected]
Wildcard Subdomains
If you need many subdomains (e.g., for WordPress Multisite), use a wildcard DNS record:
| Type | Name | Value |
|---|---|---|
| A | * | YOUR_SERVER_IP |
And a wildcard SSL certificate:
blitzpress ssl:wildcard example.com
This uses a DNS challenge instead of HTTP challenge, so you will need to add a TXT record as prompted.
Subdomain vs Subdirectory
| Approach | URL | Best For |
|---|---|---|
| Subdomain | blog.example.com | Separate application, different purpose |
| Subdirectory | example.com/blog | Same site, SEO benefits from shared domain authority |
Subdomains are treated as separate sites by search engines, while subdirectories inherit the main domain’s SEO authority.