查找要执行的php文件(名称由.htaccess隐藏)


Finding the php file which is executed (the name is hidden by .htaccess)

我在自己的网站上遇到了一个非常奇怪的情况。

当我尝试执行这个页面时:http://www.****.com/Militari/Guida-scelta-.htm或者这一页http://www.****.com/Militari/Guida-.htm

得到相同的结果。查看.htaccess/PHP文件,结果完全不可预测。

看起来如果执行的php文件将进行DB搜索并尝试找到最佳匹配结果。

这是在共享主机上。如何找到正在执行的PHP文件?

. htaccess

RewriteEngine on 
RewriteRule ^Cinema/Interviste/([^/]*)'.htm$ /Cinema/Interviste/film.php?title=$1
RewriteRule ^Cinema/dvd/([^/]*)'.htm$ /Cinema/dvd/film.php?title=$1
RewriteRule ^Cinema/([^/]*)'.htm$ /Cinema/film.php?title=$1
RewriteRule ^Attori/(.*)'.htm$ Attore.php?name=$1
RewriteRule ^Registi/(.*)'.htm$ Regista.php?regia=$1
RewriteRule ^(.*)'.htm $1'.php
RewriteRule filmrecensiti'.xml filmrecensiti'.xml'.php
RewriteRule filmrecensiti2'.xml filmrecensiti2_old'.xml
RewriteRule ^Elenco'sFilm's(.)'.php Elenco_Film_Recensiti'.php?starting_letter=$1
RewriteRule ^Elenco'sFilm'sRecensiti(.*) Elenco_Film_Recensiti$1
RewriteRule ^(.*)'.js php_js'.php'?id=$1'.js
RewriteRule ^(.*)'.css php_css'.php'?id=$1'.css
#RewriteRule ^feeds/(.+)$ feeds_items/$1 [L]
ErrorDocument 400 /not_found.htm
ErrorDocument 401 /not_found.htm
ErrorDocument 403 /not_found.htm
ErrorDocument 404 /not_found.htm
ErrorDocument 500 /not_found.htm

编辑

我错过了子文件夹

中的。htaccess

它的内容是

RewriteRule ^([^/]*)'.htm$ film.php?title=$1

多亏了你的建议,我才发现了问题。

这很有帮助:$_SERVER['PHP_SELF']$_SERVER['SCRIPT_NAME']

从你发布的内容来看,唯一适用的规则是RewriteRule ^(.*)'.htm $1'.php,建议http://www.****.com/Militari/Guida-scelta-.htm实际上会提供http://www.****.com/Militari/Guida-scelta-.php