📜  从 url .htaccess 隐藏 .php - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:38.275000             🧑  作者: Mango

代码示例2
# Run Php without filename extension
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

# Return 404 if original request is .php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]