Adding a Redirect Domain
Redirecting an Old Domain to a New One
When you change domains, you need to redirect all traffic from the old domain to the new one with a 301 (permanent) redirect to preserve SEO value and avoid broken links.
Step 1: Point Old Domain DNS
Update the old domain’s DNS A record to point to your BlitzPress server:
| Type | Name | Value |
|---|---|---|
| A | @ | YOUR_SERVER_IP |
| CNAME | www | olddomain.com |
Step 2: Add Domain to OLS Listener
The old domain needs to be mapped in OLS so the server accepts requests for it. On BlitzPress, use the panel:
blitzpress domain:alias NEW_DOMAIN OLD_DOMAIN
This adds the old domain to the vhost’s listener map.
Step 3: SSL for Old Domain
Issue an SSL certificate for the old domain so the redirect works over HTTPS:
blitzpress ssl:install OLD_DOMAIN
Step 4: Add Redirect Rule
Add a rewrite rule in the vhost configuration to redirect all requests from the old domain:
# In vhconf.conf rewrite section
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com$1 [R=301,L]
This preserves the URL path, so olddomain.com/blog/post-1 redirects to newdomain.com/blog/post-1.
Step 5: Restart OLS
sudo systemctl restart lsws
Verify the Redirect
curl -sI https://olddomain.com/some-page | grep -i location
# Should return: Location: https://newdomain.com/some-page
Important Notes
- Keep the redirect active for at least 1 year — search engines need time to update their index
- Update Google Search Console — add the new domain and use the Change of Address tool
- Check backlinks — update any backlinks you control to point to the new domain directly
- Monitor 404s — check the new domain’s logs for any paths that did not transfer correctly