簡體   English   中英

循環重定向 - .htaccess問題

[英]Loop Redirect - .htaccess issue

我想在我的localhost上解決一個問題。

我有一個使用以下.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 rewrite_module打開,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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM