我的网站上出现内部服务器错误。我检查了Apache错误日志,发现了以下错误: -
[Mon Feb 22 14:34:36.065540 2016] [core:error] [pid 660170] [client xxx.xxx.xxx.xxx:59213] AH00124:由于可能的配置错误,请求超出了10个内部重定向的限制。使用' LimitInternalRecursion'必要时增加限额。使用' LogLevel debug'获得回溯。
我在这里粘贴我的.htaccess文件: -
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(import.php) $1?%{QUERY_STRING} [L]
RewriteRule ^(phpinfo.php) $1 [L]
RewriteRule ^(robots.txt) $1 [L]
RewriteRule ^(index.html) $1 [L]
RewriteRule ^ajax/(.*) ajax/$1 [L]
RewriteRule ^css/(.*) css/$1 [L]
RewriteRule ^data/(.*) data/$1 [L]
RewriteRule ^kmz/(.*) kmz/$1 [L]
RewriteRule ^js/(.*) js/$1 [L]
RewriteRule ^dlib/(.*) dlib/$1 [L]
RewriteRule ^java/(.*) java/$1 [L]
RewriteRule ^flash/(.*) flash/$1 [L]
RewriteRule ^export/(.*) export/$1 [L]
RewriteRule ^images/(.*) images/$1 [L]
RewriteRule ^editor.php(.*) editor.php$1 [L]
RewriteRule ^config.php(.*) config.php$1 [L]
RewriteRule ^admin.php(.*) admin.php$1 [L]
RewriteRule ^ajax.php(.*) ajax.php$1 [L]
RewriteRule ^index.php(.*) index.php$1 [L]
RewriteRule ^info.php util.php?um=info&%{QUERY_STRING} [L]
RewriteRule ^util.php(.*) util.php$1 [L]
RewriteRule ^ux/([^/]*)/([^/^=]*)/(.*) util.php?um=$1&mode=$2&$3 [L]
RewriteRule ^ux/([^/]*)/(.*) util.php?um=$1&$2 [L]
RewriteRule ^ux/(.*) util.php?um=$1 [L]
RewriteRule ^([^/]*)/([^/]*).html index.php?md=$1&ref=$2&%{QUERY_STRING} [L]
RewriteRule ^([^/]*).html index.php?md=page&ref=$1&%{QUERY_STRING} [L]
RewriteRule ^([^/]*)/$ index.php?md=page&ref=$1&%{QUERY_STRING} [L]
RewriteRule ^rss/events util.php?um=rss&ref=Events&_m=EVNT [L]
RewriteRule ^u/([^/]*) index.php?md=url&ref=$1 [L]
当我将PHP从5.4升级到5.5时,问题就出现了。 有人可以帮我这个。
答案 0 :(得分:1)
RewriteCond
仅适用于下一个RewriteRule
,而不适用于.htaccess中的所有RewriteRule
。这就是说你有很多无所不能的规则也应该删除。而不是%{QUERY_STRING}
您可以使用QSA
标记。
在您的网站根目录中尝试此操作.htaccess:
RewriteEngine on
# skip all files and directories from rewrite rules below
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^info\.php$ util.php?um=info [L,QSA]
RewriteRule ^ux/([^/]*)/([^/]*)/(.*)$ util.php?um=$1&mode=$2&$3 [L,QSA]
RewriteRule ^ux/([^/]+)/(.*)$ util.php?um=$1&$2 [L,QSA]
RewriteRule ^ux/(.*)$ util.php?um=$1 [L,QSA]
RewriteRule ^([^/]+)/([^/.]+)\.html$ index.php?md=$1&ref=$2 [L,QSA]
RewriteRule ^(.+)\.html$ index.php?md=page&ref=$1 [L,QSA]
RewriteRule ^([^/]+)/?$ index.php?md=page&ref=$1 [L,QSA]
RewriteRule ^rss/events util.php?um=rss&ref=Events&_m=EVNT [L,QSA]
RewriteRule ^u/([^/]+)/?$ index.php?md=url&ref=$1 [L,QSA]