S3 bucket PDF files can't be accessed using virtual hosting style links

0

Hi there, I have a static website being hosted in an S3 bucket with Route 53 handling redirects to our short URL and everything is working well (I'm able to use relative paths in the HTML for pages, images, CSS etc.) except for with PDF files. For some reason, the PDF files can't be accessed using virtual hosting style links (such as http://www.townepoint.org.s3-website-us-west-2.amazonaws.com/images/newsign3.JPG) and only path style links (such as http://s3.us-west-2.amazonaws.com/www.townepoint.org/TPOA+Commons.pdf) work. This is breaking the ability to reference the files relatively like all of the other files on the site. Using the examples above, http://www.townepoint.org/TPOA+Commons.pdf is not a working URL when http://www.townepoint.org/images/newsign3.JPG does work.

Kim
已提问 2 年前623 查看次数
1 回答
0

Sure looks like something tricky going on there. I noticed that this works:

aws s3 cp s3://www.townepoint.org/images/newsign3.JPG foo

whereas this gets "fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden":

aws s3 cp s3://www.townepoint.org/TPOA+Commons.pdf foo

So as a first step I'd suggest reviewing bucket permissions and making sure that both the above work OK for other users.

专家
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则