I host my landers on Amazon S3 but when I visit the main page of my bucket it shows a document tree with all files in it.
How do i stop Amazon from showing this?
Thanks.
Seconded!
With .htaccess you can't fix it? Create a nope.html page and then add on .htaccess file :
Options -Indexes
ErrorDocument 403 /nope.html
ErrorDocument 404 /nope.html
ErrorDocument 500 /nope.html
What's your bucket policy look like?
This is my current policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucketname.com/*"
}
]
}
Not sure if this would work as I already have a blank 404 page set up.
I am also not sure if .htaccess works on Amazon S3.
Browse to "access control list" under the permissions tab and look for the public access section ("everyone"). Uncheck all the boxes there and save. Should be good to go.
Would that not block my landers from being accessed?
Thanks a lot, that did the trick!