循环重定向-.htaccess问题


Loop Redirect - .htaccess issue

我正在尝试解决本地主机上的一个问题。

我有一个使用以下.htaccess文件的脚本

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /agg/
RewriteCond %{HTTP_HOST} ^localhost  
RewriteRule ^(.*)$ http://localhost/agg/$1 [R=permanent,L]
RewriteRule ^index'.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /agg/index.php [L]
</IfModule>

"agg"是本地主机上存储文件的文件夹。

(完整路径:C:''wamp''www''agg)

当我尝试访问http://localhost/agg/它给我"这个网页有一个重定向循环"错误。

apache重写模块已打开,php版本为5.4.12

还有一个名为"config.php"的文件,其中包含以下代码:

<?php
$siteurl = "http://localhost";
//.... etc
?>

如有任何帮助,我们将不胜感激。

您的第一条规则是导致此循环的罪魁祸首。在/agg/.htaccess:中有此代码

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /agg/
RewriteRule ^index'.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>