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
demandé il y a 2 ans623 vues
1 réponse
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.

EXPERT
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions