Answer the question
In order to leave comments, you need to log in
How to disable direct access to files using .htaccess?
What is the task:
I have a page that pulls resources - js and css files, and also includes php sometimes, it is
necessary to prohibit direct access (that is, I want to go to pages/page1.php for example , and I get a 403 error. But if this php file will be given through , then everything will work.
is it possible (and if possible, how) using .htaccess to do this without affecting statics like the mentioned css and js files?
I would be very grateful for help, with apache and php I work recently, and then out of necessity
UPD: I roughly understand that there should probably be filtering by file types, etc., but I don’t quite understand how this is implemented. include 'pages/page1.php'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question