所以我正在一個CSS/JS壓縮系統的一個網站,有基本以下的htaccess重寫問題 - L(ast)沒有被尊重?
RewriteEngine On
...
RewriteRule ^css/images/(.*)$ images/site/$1?%{QUERY_STRING} [L]
RewriteRule ^css/([0-9a-fA-F]{32})$ assets.php?hash=$1 [L]
RewriteCond %{HTTP_HOST} ^www.site.com [NC]
RewriteRule ^(.*)$ http://site.com/$1 [L,R=301]
RewriteRule ^([a-zA-Z0-9_.-]+)$ index.php?url=$1&%{QUERY_STRING} [L]
php_flag register_globals off
php_flag magic_quotes_gpc off
php_flag register_long_arrays off
# 404 Handler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1&%{QUERY_STRING}
眼下assets.php沒有接收到哈希調用,而是index.php文件 - 如果我刪除線RewriteRule ^([a-zA-Z0-9_.-]+)$ index.php?url=$1&%{QUERY_STRING} [L]
它工作正常,但我不知道爲什麼 - 資產重寫RewriteRule ^css/([0-9a-fA-F]{32})$ assets.php?hash=$1 [L]
上的[L]標誌不應該阻止任何進一步的重寫被執行?我對這裏發生的事情感到困惑。
任何你可以擺脫這一點的光將不勝感激。
謝謝各位大大順便說一句,這真的回答我的問題。 – donatJ 2010-09-01 17:42:06