2017-03-01 58 views
0

我有在Apache2的mod_rewrite的一個問題,我已使mod_rewrite但doesent負載我得到這個消息:ERR_TOO_MANY_REDIRECTSmod_rewrite的ERR_TOO_MANY_REDIRECTS

的的.htaccess:

RewriteEngine on 
RewriteRule ^(\w+)$ index.php?page=$1 [L,NC,QSA] 

RewriteRule ^(\w+)+\/$ index.php?page=$1 [L,NC,QSA] 

RewriteCond %{HTTP_HOST} !^$ 

RewriteCond %{HTTP_HOST} !^www\. [NC] 

RewriteCond %{HTTPS}s ^on(s)| 

RewriteRule^http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 

IDK什麼是錯的。

+0

請分享apache.conf以及您正在使用的Apache版本。謝謝。 檢查這些鏈接: http://serverfault.com/questions/595458/mod-rewrite-error-code-err-too-many-redirects http://serverfault.com/questions/698711/getting-錯誤 - 太多重定向 - 何時嘗試訪問網站 http://stackoverflow.com/questions/36266626/how-to-fix-htaccess-error-with-multiple-rewrite-rule-err -too-many-redirects –

+0

錯誤消息顯示Apache在重定向之間的無限循環中崩潰,因此請檢查以前的鏈接並檢查重定向鏈。 –

+0

試過但沒有運氣,我的apache.conf:http://pastebin.com/RaxWt8MG –

回答

0

使.htacess更簡單,更清潔。

RewriteEngine on 
RewriteCond %{HTTP_HOST} !^$ 
RewriteCond %{HTTP_HOST} !^www\. [NC] 
RewriteRule ^/(.*) http1://www.%{HTTP_HOST}%/$1 [R=301] 
RewriteCond "%{REQUEST_URI}" "!=/index.php" RewriteRule "^(.*)" "/index.php?page=$1" [L,PT] 

它的解決方案作爲主要步驟沒有使用SSL。

相關問題