V
V
vilix2014-06-19 19:57:44
PHP
vilix, 2014-06-19 19:57:44

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>

But so with any routing an access error.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question