2011-05-25 28 views
0
<VirtualHost _default_:80> 

<IfModule mod_rewrite.c> 
Options +FollowSymLinks 
RewriteEngine on 
RewriteMap lc int:tolower 
RewriteCond %{REQUEST_URI} [A-Z] 
RewriteRule (.*) ${lc:$1} [R=301,L] 
</IfModule> 

</VirtualHost> 

這將整個請求uri更改爲小寫。我希望這發生在特定文件夾(/css),但RewriteMap在.htaccess中不起作用。我是正則表達式和重寫的新手。我需要一個RewriteCond,它只能檢查/css/<any subfolder> and/or <files>.任何身體的幫助?Apache重寫條件 - 任何想法?

編輯:

<IfModule mod_rewrite.c> 
Options +FollowSymLinks 
RewriteEngine on 
RewriteMap lc int:tolower 
RewriteCond %{REQUEST_URI} [A-Z] 
RewriteCond %{REQUEST_URI} ^/css/ 
RewriteRule (.*) ${lc:$1} [R=301,L] 
</IfModule> 

這似乎是工作的罰款特定文件夾 - /css/。不知道這是傻瓜證明

</VirtualHost> 

回答