user5903926 user5903926 - 3 months ago 9
PHP Question

PHP .htaccess files can be reached as directory! How to disable?

I have files in my server like

test.php
,
demo.php
, which I can access on my server as
example.com/demo/
or
example.com/demo
. How can I disable it? It overlaps my
.htaccess
.

Answer

This is because multiviews are enabled on your server, you can disable them by using the following line in your htaccess

Opitions -Multiviews