开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜