Answer the question
In order to leave comments, you need to log in
How to configure apache2 to disable php file execution?
It’s hard to somehow form a question in my head, I’ll try to explain what I need.
There is a site written in php (not by me)
There is my local apache2 server
Everything is arranged on the site through index.php. i.e. if you are accessing sitename/contacts, then it seems to include it in its index.php. BUT that's the problem, if I, for example, access contacts (routing to this url in index.pshp is pre-configured) and there is a contacts.php file in the site directory, then the contacts.php file itself opens, i.e. without inclusion. But if you specify the contact url in the routing to contacts.php , then contacts.php will load as it should with all the necessary data.
Actually, the question is how to configure Apache for this? Since everything works as it should on a remote (not mine) server.
Tried like this:
Order Allow,Deny
Deny from all
<Files "index.php">
Order Deny,Allow
Allow from all
</Files>
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