UrlRewrite 不适用于任何资源文件

发布于 2024-12-05 07:02:05 字数 490 浏览 1 评论 0原文

我正在使用Tuckeys Urlrewrite重定向我的应用程序上的任何请求,以便根据URL采取一些操作。我需要能够捕获任何请求,但是我不想从资源中获取一个请求,因此基本上,它看起来像/images/something.png/css/something.css,但是我需要能够捕获/web/http://www.google.com/例如。基本上,资源只有少数数量的可能性,我只是不知道如何排除它们。首先,我不能通过在正则表达式中没有\。来接受它们,但是与Google相关的示例不起作用。因此,我也需要抓住这些点,而且由于我对等级不太好,所以我也不知道如何抓住anmpersand。

因此,我有两个问题:

  1. 除了可能以/images/开头的资源之外,我该如何捕获任何问题容易)
  2. 如何也使用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:

  1. 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)
  2. How to catch urls with ampersands too (actually could be in the first question too)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

输什么也不输骨气 2024-12-12 07:02:05

您可以使用 RewriteCond (doc) 来做吧。

You can use RewriteCond (doc) to do it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文