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
preguntada hace 2 años623 visualizaciones
1 Respuesta
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.

EXPERTO
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas