的.htaccess的開始是htaccess rewriterule,[R,L = 301]標誌不會停止它。爲什麼?
RewriteEngine On
#begin of rules for administration folder, redirect to https, if not https
RewriteCond %{REQUEST_URI} ^/administration
RewriteCond %{HTTPS} off
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [R,L=301]
#end of rules for administration folder
#===no rules for /administration folder below this line===
#the rest part of .htaccess
爲什麼剩下的.htaccess的一部分,仍然執行了https://www.mydomain.com/administration/index.php
?如何停止執行管理文件夾後面的url的.htaccess文件的其餘部分?我的代碼有什麼問題? 謝謝。
卸下'L'標誌有時會引起問題。 – Gerben 2012-02-04 12:48:02
真的嗎?我從來沒有遇到過的問題。在什麼情況下? – baynezy 2012-02-04 14:29:19
您幾乎總是希望將[R]與[L]結合使用(即使用[R,L]),因爲[R]標誌本身預先設置爲http:// thishost [:thisport] to該URI,然後將其傳遞給規則集中的下一個規則,這通常會導致「請求中的URI無效」 uest'警告。 (http://httpd.apache.org/docs/current/rewrite/flags.html#flag_r) – Gerben 2012-02-04 15:44:53