- Newest
- Most votes
- Most comments
Hi,
The tutorial for configuring WordPress with a Lightsail content delivery network has been updated. Please refer to the doc here: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-wordpress-for-distribution.html
Thank you.
The site seems to still have issues as when I use some pages it goes blank and mixes content.
See the screenshots.
answered 25 days ago
Have you tried the tutorial for enabling static content caching through the distribution?
Yes, I have implemented that tutorial.
Hello, is your site loading correctly now?
If still no, could you try either adding CloudFront-Forwarded-Proto to the forwarded headers on your distribution's cache behavior, or (if your instance has a valid SSL certificate) setting the distribution's origin protocol policy to "HTTPS only"? In either case, please reset the distribution cache afterward and then reload your site.
This seems to be the solution: (Which is not in the tutorial)
However, if you're using a newer version (3.3.1-5 or higher), you need to specify your actual domain in the WP_SITEURL and WP_HOME definitions rather than using the dynamic $_SERVER['HTTP_HOST'] variable.
There is still an issue with the website as it loads very slowly and gets a lot of errors when loading new pages. See site at: https://kliek.co
Hi,
Thanks for reaching out!
www.kliek.co currently has a CNAME record pointing to your distribution. However, kliek.co (your apex domain) has no record pointing to your distribution, so it doesn't resolve. The reason for this difference is that DNS doesn't allow CNAME records at the zone apex—apex and subdomain domains require different record types.
To fix this, please:
- Go to Domains & DNS → your DNS zone → DNS records → Add record
- Add an A record for kliek.co (your apex domain)
- Set Resolves to your distribution
- Leave the existing CNAME for www.kliek.co as-is. It's already correct
After you save, please allow a few minutes for DNS to propagate. Once it does, kliek.co will load just like www.kliek.co does.
For additional details, you can reference: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-point-domain-to-distribution.html
I understand you're experiencing issues with configuring your WordPress instance to work with a Lightsail content delivery network distribution. Let me help troubleshoot these problems.
For the first issue where the website content vanishes and only 'domain' shows in the URL bar, this typically indicates that the WP_SITEURL and WP_HOME values in your wp-config.php file need to be set correctly. When using WordPress version 3.3.1-5 or higher, you should replace 'DOMAIN' in the configuration with your actual domain name. The code should look like: define('WP_SITEURL', 'http://yourdomain.com/'); and define('WP_HOME', 'http://yourdomain.com/'); - making sure to use your actual domain instead of the placeholder text.
For the 503 Gateway error you're seeing with the second tutorial, this often occurs when there's a mismatch between your distribution's origin protocol policy and your WordPress instance configuration. Here are some key things to verify:
- Ensure your WordPress instance is running and accessible before testing the distribution
- Check whether your WordPress site uses HTTP or HTTPS as the origin - this determines how your distribution should be configured
- If your website uses HTTP only, configure your distribution to terminate SSL/TLS and forward requests using an unencrypted connection
- If your website uses HTTPS, configure your distribution for end-to-end encryption
- Verify that you've restarted the Apache service after making changes to the wp-config.php file
The code you're using appears correct for WordPress version 3.3 or lower. However, if you're using a newer version (3.3.1-5 or higher), you need to specify your actual domain in the WP_SITEURL and WP_HOME definitions rather than using the dynamic $_SERVER['HTTP_HOST'] variable.
I'd recommend double-checking which WordPress version you're running and ensuring you're using the appropriate code snippet for that version, with your actual domain properly specified where needed.
Sources
Configure WordPress with a Lightsail content delivery network - Amazon Lightsail
Configure WordPress with a Lightsail content delivery network - Amazon Lightsail
Relevant content
asked 4 years ago
asked 3 years ago

Thank you. It works.