I made a rest PHP server so most of paths looks like this
/test/home.php/product
My intention is to secure the api and prevent the access directly to the PHP files. After some research ,I found someone asking about how to hide PHP extention and this was his solution :
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
so the new route is /test/product
and it gives the same response as /test/home.php/product
but this seems useless because the old url is still working
Can't i prevent the access is the PHP extention appear in the url ?
PS: my question is different from htaccess prevent access to .php and allow only with RewriteRule
since i demand to protect the routes that contains php extention inside them not ends with php