apache将我的所有php页面重写为htm和fobidden all.php请求

apache将我的所有php页面重写为htm和fobidden all.php请求,apache,rewrite,Apache,Rewrite,作为标题,我想将我所有的php页面重写为'htm',fobidden all.php请求,人们只能通过像'.htm?querystring'这样的url访问页面,但不能通过'.php'获得结果,我该怎么办?我写了下面的规则,但它不起作用(所有页面都是404) 通过httpd.conf启用mod_rewrite和.htaccess,然后将此代码放入文档根目录下的.htaccess: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on

作为标题,我想将我所有的php页面重写为'htm',fobidden all.php请求,人们只能通过像'.htm?querystring'这样的url访问页面,但不能通过'.php'获得结果,我该怎么办?我写了下面的规则,但它不起作用(所有页面都是404)


通过
httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放入
文档根目录下的
.htaccess

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On

# block .php extension
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php[\?\s] [NC]
RewriteRule ^ - [F]

# convert .htm/.html to .php
RewriteRule ^(.+?)\.html?$ $1.php [L,NC]

通过
httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放入
文档根目录下的
.htaccess

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On

# block .php extension
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php[\?\s] [NC]
RewriteRule ^ - [F]

# convert .htm/.html to .php
RewriteRule ^(.+?)\.html?$ $1.php [L,NC]

不起作用,apache日志中的错误,“由于可能的配置错误,请求超过了10个内部重定向的限制。如果必要,使用'LimitInternalRecursion'增加限制”,似乎是一个无休止的循环不起作用,apache日志中的错误,“由于可能的配置错误,请求超出了10个内部重定向的限制。如有必要,使用“LimitInternalRecursion”来增加限制”,这似乎是一个无休止的循环