This is a common issue when setting up a new site before updating DNS. The preview feature has limitations, but there are several workarounds. Here’s how to test your WordPress site locally before updating DNS:
Solution 1: Modify Your Local Hosts File (Recommended)
This temporarily redirects the domain to your CyberPanel server IP on your local machine only.
Windows:
- Open Notepad as Administrator
- Open file: C:\Windows\System32\drivers\etc\hosts
- Add this line at the bottom:
YOUR_SERVER_IP the.site.tld
- Save the file
- Open Command Prompt as Administrator and run: ipconfig /flushdns
macOS:
- Open Terminal
- Run: sudo nano /etc/hosts
- Add this line at the bottom:
YOUR_SERVER_IP the.site.tld
- Save (Ctrl+X, then Y, then Enter)
- Flush DNS: sudo dscacheutil -flushcache
Linux:
- Open terminal
- Run: sudo nano /etc/hosts
- Add this line at the bottom:
YOUR_SERVER_IP the.site.tld
- Save (Ctrl+X, then Y, then Enter)
- Flush DNS: sudo systemctl restart systemd-resolved (Ubuntu/Debian) or sudo service network restart (CentOS/RHEL)
Solution 2: Create a Subdomain (Alternative)
- Create a subdomain like test.yourdomain.com in CyberPanel
- Point this subdomain’s DNS to your server IP
- Set up your WordPress site under this subdomain for testing
- Once satisfied, migrate to the main domain
Important Notes:
- Solution 1 (hosts file) is the cleanest approach as it doesn’t require WordPress configuration changes
- Always remove the hosts file entry after DNS is updated
- The preview feature you mentioned has known limitations with redirects
- Make sure your WordPress site is configured with the correct domain in CyberPanel before testing
After Testing:
- Remove the hosts file entry (Solution 1)
- Update your domain’s DNS to point to the CyberPanel server IP
- Wait for DNS propagation (usually 24-48 hours)
- Your site should then be accessible via the normal domain
This approach lets you fully test your WordPress site, including admin access, themes, and plugins, before making the DNS switch.