help .php
nsultaan opened this issue · comments
Ironick commented
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 ❤️
Diego Muñoz commented
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):
- index.php:
define('IS_ROUTER_FILE', true);
- home.php:
if(!defined('IS_ROUTER_FILE')) exit();
Bramus commented
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)