I have a page called index.php. I want the user can call it by HTML extension. I already done it with the line: uri replace .html .php
But I want the user can’t call PHP extension directly. Resuming, if the user call directly index.php, the request would be denied (404 error). But if the user call index.html, the request redirect to real index.php. I tried:
@php path *.php
respond @php 404
uri replace .html .php
But this way, all requests are denied.
2. Error messages and/or full log output:
No error message. Only… all the requests are denied
This implies that you’re setting your webroot to the root of your git repo. That’s not the right way to do it.
Modern security best-practice is to have a public directory which contains your index.php, and you set your server’s webroot to that public/ directory. This makes sure users can’t browse through the rest of your source code, and you can control what’s accessible by putting assets in public/.
I’m confused about what you’re trying to do. It doesn’t really make sense.
The modern way to write PHP apps is to have all requests go through index.php (which is the default behaviour of php_fastcgi) and your index.php routes the request based on REQUEST_URI to run whatever code is necessary. PHP frameworks make this easy.
I would like to hide the tecnology that my sites uses. So I’d like my pages don’t answer if called directly with the php extension. I’d like it answer only calling html extension.
(I don’t write in english very well. Please forgive some mistake…)