开发者

Apache RewriteCond

开发者 https://www.devze.com 2023-03-03 14:07 出处:网络
I have 开发者_Go百科the following rewritecond: RewriteCond %{REQUEST_FILENAME} \\.(css|js)$ Which works great and takes care of requests like:

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

精彩评论

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