我是编码的新手,需要你的帮助。我通过.htaccess用以下代码隐藏了我的.php扩展名:
RewriteEngine on
RewriteRule ^(.+)\.php$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ /$1.php [NC,END]
但是有一个页面(submit.php),其中.php扩展名需要在该页面中处理我的代码,否则它会显示一个空白页面。是否有办法将特定页面形式列入白名单而不删除.php扩展名?
答案 0 :(得分:1)
在htaccess文件的顶部,添加以下规则:
th
这将从您的规则中排除 /submit.php URI。