I'm developing a PHP web app and I feel concerned that image paths expose their locations (directory path) when the developer tools is opened for page inspection.
Example: "app/users/secretUsers/johnDoe.img"
Shouldn't this undermine the security of the site in some ways? Is there a way to get around this?
Most PHP frameworks have a public directory to place the images, Javascript, CSS, etc.
But if you are creating a web app without using a framework, the easiest workaround I used is to create a index.php in my public directories and redirect all the requests to the homepage.
Example:
If your url is www.mywebApp.com/images then you will be redirected to the homepage. But if your url is www.mywebApp.com/images/user.jpg then you can access the image.