Search code examples
amazon-web-servicesamazon-s3amazon-cloudfront

s3 bucket URL works but when I go to actual URL hosted by Cloudfront my email form is not working, permission issue?


I am a AWS beginner, I am using an S3 bucket and using cloudfront to host it. Everything is running smoothly but I wanted to make my email form functional so I added some more html that uses a POST request to Formspree (an email service). Everything on the S3 bucket URL is working perfectly and the form sends to my email but it does not seem to work on my actual URL. I read that in order for them to update it to cloudfront that you should delete the file and upload a new file with a different name. I did that, reset the distributions and it is not working. When I try to submit the form I get this URL 'https://coryfriedt.com/?name=sdfds&subject=sdfds&email=yo%40google.com&message=sdgsdgdsfg' I am thinking maybe this might be a permissions issue or maybe AWS just takes a while to update. Any help would be greatly appreciated, thanks. The website is coryfriedt.com or www.coryfriedt.com


Solution

  • Based on what you described it seems that an older version of your files is still being served, you might want to invalidate these files.

    More info on how to do it can be found on AWS Docs.