Let me explain our architecture first.
www.example.com CNAME points to cloudfront distribution (d3xxxxx.cloudfront.net)
Origin for the cloudfront: route.example.com. We had select **Whitelist Headers ** as HOST in cloudfront distribution
SSL installed on Cloudfront for the domain : www.example.com
route.domain.com points to Google cloud server which has apache webserver and wordpress installed.
Issue 1. When we hit the URL www.example.com without applying SSL certificate, the home page loads www.example.com however internal links redirecting to 'route.example.com' instead of www.example.com. We believe its because of siteurl on wordpress uses route.example.com
Issue 2. After applying SSL certificate on cloudfront, when we hit the URL 'https://www.example.com', the website ended up too many redirects
We have tried the URL "WordPress + CloudFront Flexible SSL ends up in redirect loop (https)" and it doesn't seems to be helping us.
Goal: We want www.example.com to use cloudfront distribution along with SSL and doesnt want to expose webserver to enduser. The origin of the cloudfront should be route.example.com which will have wordpress application.
Any help would be appreciated.