我想在我的本地开发机器上实现一个新的重写规则。我已经制定了13条规则,并且一切正常(甚至在撰写本文时)。但是,由于某种原因,最新的一个投掷我500内部服务器错误。Apache ReWriteEngine抛出500内部服务器错误导致太多内部重定向...为什么?
重写规则是:
RewriteRule stuff/public_html/vault/mystuff/view/(.*) /stuff/public_html/vault/mystuff/view/index.php?stuff=$1
RewriteRule stuff/public_html/vault/mystuff/view/(.*)/ /stuff/public_html/vault/mystuff/view/index.php?stuff=$1
经过我的Apache日志和得到这个:
[Thu Jan 13 22:07:43 2011] [error] [client ::1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://localhost:8888/stuff/public_html/vault/mystuff/all/index.php?curr=7
在剧本我想重定向到查看/ index.php的东西= $ 1,没有任何东西甚至可以远程类似于任何类型的重定向。我有一个非常,非常基本的会话验证被称为在登陆脚本的顶部,这是如下:
//Start session
session_start();
//Check whether the session variable SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
header("location: ".$root_http."");
exit();
}
然而,当我直接访问该页面,它作为应该和有没有重定向。我的所有其他ReWrite规则及其相应的着陆页都以完全相同的方式设置。
这是在吹我的脑海。任何帮助,请!!
在从马克BI建议开启RewriteLog,以及与此想出了:
:: 1 - - [13 /月/ 2011:23:00:09 --0500] [本地主机/ SID#807df8 (2)[per-dir/Users/stepheng/Development /] rewrite stuff/public_html/vault/mystuff/view/index.php - >/stuff/public_html/vault/mystuff/view/index.php?stuff = index.php
:: 1 - - [13/Jan/2011:23:00:09 --0500] [localhost/sid#807df8] [rid#941b38/initial/redir#10](3)split uri =/stuff/public_html/vault/mystuff/view/index.php?stuff = index.php - > uri =/stuff/public_html/vault/mystuff/view/index.php ,args = stuff = index.php
:: 1 - - [13/Jan/2011:23:00:09 --0500] [localhost/sid#807df8] [rid#941b38/initial/redir#10](3)[per-dir /用户/ stepheng/Development /]将模式'stuff/public_html/vault/mystuff/view /(.*)/'应用于uri'/stuff/public_html/vault/mystuff/view/index.php'
:: 1 - - [13/Jan/2011:23:00:09 - 0500] [localhost/sid#807df8] [rid#941b38/initial/redir#10](1)[per-dir/Users/stepheng/Development /]内部重定向与/stuff/public_html/vault/mystuff/view/index.php [内部重定向]
它看起来像它试图发送参数?stuff = index.php,但我不明白如何这是可能的。有任何想法吗?
你说得对,我没有注意到。我将目的地的名称更改为index2.php,更新了.htaccess,重新启动了服务器,并且仍然抛出500 – 2011-01-14 04:07:26
因为它仍然匹配。你添加了[L]吗?或者移动索引mystuff/view/ – 2011-01-14 04:10:49