I am useing the following folder structure:
localhost
server
php
docs
classes
errors
...
client
css
javascript
...
All documents which should be opened by the user via url are located in the server/php/docs directory.
localhost/server/docs/index.php
localhost/server/docs/any_other_document_in_this_folder.php
But something like this should not be possible:
localhost/server/classes/language.php
localhost/server/errors/error404.php
localhost/client/javascript/buttonhandler.js
How can I forbid the user to open files on this way?
2
Answers
I am using now 5 redirects. Maybe it is possible to use not as much.
My posted solution does not work. Every url used in documents in the directory
is redirected. Also stuff like
So my question is: is it possible (and how) that the user is not able to open URLs as I posted at the very beginning? I would prefer that in this case the user is redirected to