UrlRewrite 不适用于任何资源文件
我正在使用Tuckeys Urlrewrite重定向我的应用程序上的任何请求,以便根据URL采取一些操作。我需要能够捕获任何请求,但是我不想从资源中获取一个请求,因此基本上,它看起来像/images/something.png
或/css/something.css
,但是我需要能够捕获/web/http://www.google.com/
例如。基本上,资源只有少数数量的可能性,我只是不知道如何排除它们。首先,我不能通过在正则表达式中没有\。
来接受它们,但是与Google相关的示例不起作用。因此,我也需要抓住这些点,而且由于我对等级不太好,所以我也不知道如何抓住anmpersand。
因此,我有两个问题:
- 除了可能以
/images/
开头的资源之外,我该如何捕获任何问题容易) - 如何也使用ampersands捕获URL(实际上也可能是第一个问题)
I am using Tuckeys UrlRewrite for redirecting any requests made on my application so that I can do some actions depending on the url. I need to be able to catch any requests, but I don't want to get the one from the resources, so basically it would be anything that looks like /images/something.png
or /css/something.css
, but I need to be able to catch /web/http://www.google.com/
for example. Basically, there are only a few number of possibilities for the resources, I just can't figure out how to exclude them. At first, I was able not to take them by not having the \.
in the regex, but then the example with google wouldn't work. So I need to catch the dots as well, and also since I am not that good with regex I couldn't figure out how to catch ampersand as well.
So I have two questions:
- How do I catch anything except for resources that could start with
/images/
for example (if it's a<condition>
element then others would be easy) - How to catch urls with ampersands too (actually could be in the first question too)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
RewriteCond
(doc) 来做吧。You can use
RewriteCond
(doc) to do it.