我試圖重寫不存在的URL來使用我的index.php文件,同時還將HTTP:Authorization環境變量附加到我的腳本中。到目前爲止,我一次只能得到一個或另一個工作。不是都。有人能告訴我我的.htaccess中的錯誤在哪裏?Apache .htaccess配置問題中的多個RewriteConditions
RewriteEngine on
# Get HTTP authorization
RewriteCond %{HTTP:Authorization} ^Basic.*
# Append to URL
RewriteRule (.*) index.php?_auth=%{HTTP:Authorization} [QSA,L]
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule (.*) index.php?_auth=%{HTTP:Authorization} [QSA,L]
我不知道你爲什麼這樣做,當然授權頭必須在PHP中可訪問? – kjetilh 2013-03-07 22:31:34