It has been a busy few days on the workbench. After getting everything settled in the new Proxmox environment and cleaning up my local network configuration, I finally got around to fine-tuning my custom WordPress block theme, Fossil. Things were going incredibly smoothly until I decided to switch the blog’s access from a local IP address to a proper domain name. Almost instantly, I hit a wall and was locked out with a frustrating 403 Forbidden error.
Troubleshooting the Domain Switch
When you transition a site from an IP address to a domain name, especially when you have multiple containers and networks talking to each other, things can easily break. After some digging, I figured out the problem, so I am dropping the fix here in case anyone else runs into the same issue.
Step 1: Check for SSL / Protocol Mismatches (HTTP vs HTTPS)
If the site was set to http:// under the IP address, but your domain is configured to enforce or redirect to https:// (or vice versa), Apache or Nginx may block admin subdirectories. This happens when SSL/TLS certificates or proxy headers aren’t properly passed.
To test this, you need to open your wp-config.php file and temporarily disable administrative SSL enforcement. Add this line:
PHP
define('FORCE_SSL_ADMIN', false);
If you are behind a Reverse Proxy or Load Balancer (e.g., Cloudflare, Nginx proxying to Apache), WordPress might not recognize HTTPS traffic. You will need to add this specific header check just above the /* That's all, stop editing! */ line in your wp-config.php:
PHP
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
Things to Notice: Additional 403 Troubleshooting
If the protocol mismatch wasn’t the root of your issue, here are two other important steps to check when dealing with 403 errors:
- Verify File Permissions: A 403 error literally means access is denied by the server. You need to ensure your directories are set to 755 and your files are set to 644. If they are too restrictive, the server will block WordPress from loading.
- Regenerate your .htaccess File: URL changes often corrupt rewrite rules. You can rename your existing .htaccess file via the command line to disable it. Once disabled, log into your WordPress dashboard and resave your permalinks to force the system to generate a fresh, working file.
Getting all these moving parts to talk to each other correctly is half the battle when self-hosting, but finally seeing the site load cleanly on the new domain makes it worth the effort. I hope this saves someone else a bit of troubleshooting time!

Leave a Reply