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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠