Apache RewriteCond
I have 开发者_Go百科the following rewritecond:
RewriteCond %{REQUEST_FILENAME} \.(css|js)$
Which works great and takes care of requests like:
http://domain.com/js/script.js
and http://domain.com/css/stylesheet.css
However I would like to exclude if the pattern is:
http://domain.com/projects/{varname}/{varname}/download/{varname}/{varname}.js
or
http://domain.com/projects/{varname}/{varname}/download/{varname}/{varname}.css
Where {varname}
can be anything.
Is it possible to change my RewiteCond in a way so that the downloads are excluded?
You can just add another RewriteCond
before the current:
RewriteCond %{REQUEST_FILENAME} !\/download\/
RewriteCond %{REQUEST_FILENAME} \.(css|js)$
RewriteRule ....
Hope the helps.
精彩评论