- Newest
- Most votes
- Most comments
Try forwarding host header to origin in your cloudfront distribution
https://stackoverflow.com/questions/68876033/apache-redirecting-example-com-to-ec2-public-dns
The problem is occurring because your webserver is issuing a redirect:
GET https://deepdungeonoverlay.com/targetinfo
HTTP/2 301 Moved Permanently
content-type: text/html; charset=iso-8859-1
content-length: 267
location: http://ec2-54-91-190-28.compute-1.amazonaws.com/targetinfo/
date: Wed, 18 Jan 2023 09:39:26 GMT
server: Apache/2.4.54 () OpenSSL/1.0.2k-fips
x-cache: Miss from cloudfront
via: 1.1 b9061e936b29505d1b542db7af99b46c.cloudfront.net (CloudFront)
x-amz-cf-pop: LHR61-C2
x-amz-cf-id: TJkYZFqX1vFlXXhG6KpNLHj2_GLatCCaqOMPHV6cGitwfUbetnWyCQ==
X-Firefox-Spdy: h2
You will need to adjust your webserver configuration to remove the redirect in order to solve the problem.
Thank you for the answer!
So I've spent a couple hours looking around at Apache redirect articles and videos. My issue is I cannot find anything in my server's config where a redirect is happening. I can find resources on how to add a redirect (in this case I assume by adding this stuff to the httpd.conf file but my current httpd.conf file is very sparse and has no redirect).
I have a very bare bones EC2 instance, the only thing I have installed is httpd and copied my content up to var/www/html/
Relevant content
- asked 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 months ago
So this appears to have worked but only for the www.deepdungeonoverlay.com domain, it has not worked for deepdungeonoverlay.com even though I made the same update to both distributions
I ended up finding it ridiculous I had two distributions for the same domain so I kept a single distribution for both deepdungeonoverlay.com and www.deepdungeonoverlay.com and listed them both as CNAMEs in the alternate domain names setting and just set both A records in Route 53 to go to the same distribution. I have that single distribution forwarding the HOST header as described above and it appears to be working.
Thanks for the help!