bramus / router

A lightweight and simple object oriented PHP Router
MIT License
1.09k stars 245 forks source link

help .php #184

Closed nsultaan closed 2 years ago

nsultaan commented 2 years ago

hey i set everything but i face problem

/home but if user visit /home.php its also work

so my question is how to block access of .php file ??

sorry for bed english and thank u for amazing router ❤️

alixti commented 2 years ago

You could try something like this (of course you need to put it where you find it convenient, like, in the beggining of the file):

bramus commented 2 years ago

You should place these files outside of your public folder that is served by the webserver. Ideally, this public folder only contains an index.php and a .htaccess (or equivalent)