Apache 重写条件
我有以下 rewritecond:
RewriteCond %{REQUEST_FILENAME} \.(css|js)$
效果很好,可以处理如下请求:
http://domain.com/js/script.js
和 http://domain.com/css/ stylesheet.css
但是我想排除模式是否为:
http://domain.com/projects/{varname}/{varname}/download/{varname}/{varname}.js
或
http://domain.com/projects/{varname}/{varname}/download/{varname}/{varname}.css
其中 {varname} 可以是任何东西。
是否可以更改我的 RewiteCond 以排除下载?
I have 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在当前之前添加另一个
RewriteCond
:希望有帮助。
You can just add another
RewriteCond
before the current:Hope the helps.