I have put a folder in the public web directory of my WordPress installation where I have some images used by a legacy system.
Say its located under .png
.
I have changed the rights on that folder to 0444
so it should be readable.
For some reason, I can't access the images in that folder. For some reason it returns 404
.
Any clues on how to solve this?
I have put a folder in the public web directory of my WordPress installation where I have some images used by a legacy system.
Say its located under http://example.com/legacy-images/image1.png
.
I have changed the rights on that folder to 0444
so it should be readable.
For some reason, I can't access the images in that folder. For some reason it returns 404
.
Any clues on how to solve this?
For directory (folder), only read
is not enough. You need to set execute
also. Because for directory, execute
means you can enter the directory.
read
permission & directory needs read
& execute
permission.So the directory permission should be: 0555
. However, image files inside that directory should be just read
, in numeric form: 0444
.
For example, in your case, /legacy-images/
directory will have 0555
permission & /legacy-images/image1.png
image file will have 0444
permission.
If you can access shell and know how to, you may use the following shell commands (replace <WP_DIRECTORY>
with appropriate WordPress installation directory):
cd <WP_DIRECTORY>
chmod 555 legacy-images/
cd legacy-images/
find ./ -type f -exec chmod 444 {} \;