I have some pages to demonstrate how to include and use some code. Therefore I load js, css and images with sftp to a directory in /wp-content/uploads/ and describe how to use it.

Now I would like to demonstrate Leaflet Draw. There is a css file loading an image. If I call the page, it works, but the image does not load in Firefox and Chrome. I get a 403 error. If I call the image only, I see it. It has the right Content-Type. Safari works as expected. If I move these files to /wp-content/mydir/ it works with all browsers.

If I change spritesheet.svg to spritesheet.png it is the same behavior.

I know, there are some special settings for uploaddir. Which ones I have to change to make it work? Thank you very much.

  • this is unlikely to be a WordPress coding issue and more likely to be an Nginx/Apache issue, especially since directly visiting the URL works. Check your hosts security protections. Otherwise keep in mind what you're doing with the uploads folder is not normal or standard. Those assets are supposed to be in the plugins folder, or referenced via attachment IDs to generate URLs at runtime, then embedded with blocks/shortcodes/widgets. I would be suspicious of leaflet.draw, it could be interpreted as a file extension and a malformed URL
    – Tom J Nowell
    Oct 18, 2023 at 14:20

1 Answer 1


You are right, it was a .htaccess issue. I am only confused that it worked with Safari.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.