2013-06-24 77 views
0

你好,我有一個重定向循環繼續我的.htaccess。我在example.example.com上有一個網站,腳本的位置位於example.example.com/index/。當我去example.example.com時,我只能看到文件夾目錄,但是我可以通過example.example.com/index/訪問我的腳本,我已經使用301 forward插入了一個.htaccess,但是我得到了無盡的重定向循環。當某人輸入example.example.com並獲取example.example.com/index/時,如何使用php,html或.htaccess進行指導?我似乎無法弄清楚這一點。任何幫助是極大的讚賞。.htaccess重定向循環,無法讓網站工作

+0

請添加代碼...或者至少嘗試的.htaccess然後才提問。 – luk2302

+0

是的。告訴我們你的'.htaccess'文件裏有什麼,這樣我們就可以看到毛刺可能在哪裏。另外,請考慮閱讀[何時不使用重寫](http://wiki.apache.org/httpd/WhenNotToUseRewrite)。 – pjmorse

回答

1

的index.php <?php header("location: ./index/");?>

OR

的index.html <meta http-equiv="refresh" content="0; url=/index/">

OR

把你的.htaccess在根文件夾重定向規則,並把另一個的.htaccess中index文件夾:RewriteEngine off停止循環

(在根文件夾)

+0

for the php這是我得到的「警告:不能修改標題信息 -/home/example/public_html /項目中已經發送的標題(輸出開始於/home/example/public_html/projects/index.php:6) /index.php第6行「 – user1965212

+0

php代碼需要在文件的第一行,之前沒有空格 – Falci

+0

優秀的答案!我能夠通過在代碼爲「」:) – user1965212