.htaccess - 重写规则生成503错误

时间:2015-12-14 09:54:20

标签: apache .htaccess mod-rewrite http-status-code-503

我想请求帮助。 我有.htaccess像这样:

Options +Indexes
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^advert/([^/]+)/?$ advert.php?id=$1 [L]

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^adverts/([^/]+)/?$ adverts.php?kat=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]

问题在于它导致503错误。

在错误日志中,我看到:

这样的网址: example.com/advert/test 会产生此错误:

[Mon Dec 14 10:01:24 2015] [error] [client 157.55.39.109] client denied by server configuration: /data/web/virtuals/56654/virtual/www/advert

以及后来的这个:

[Mon Dec 14 10:06:25 2015] [error] [client 2a03:2880:1010:6fe8:face:b00c:0:8000] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

我哪里错了? 谢谢大家。

0 个答案:

没有答案