简体   繁体   English

阻止Web服务器上的URL(websphere)

[英]Blocking url on web server (websphere)

plugin-cfg.xml file has record which allows all urls on the server: <Uri AffinityCookie="WS_JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/web/*"/ %gt; plugin-cfg.xml文件包含允许服务器上所有URL的记录:<Uri AffinityCookie =“WS_JSESSIONID”AffinityURLIdentifier =“jsessionid”Name =“/ web / *”/%gt;

Is there any way to block one particular url and leave the rest open? 有没有办法阻止一个特定的网址,其余的打开?

Something like: 就像是:

<Uri AffinityCookie="WS_JSESSIONID" AffinityURLIdentifier="jsessionid" Name="^/web/abc/xyz"/ > <Uri AffinityCookie="WS_JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/web/*"/ > <Uri AffinityCookie =“WS_JSESSIONID”AffinityURLIdentifier =“jsessionid”Name =“^ / web / abc / xyz”/> <Uri AffinityCookie =“WS_JSESSIONID”AffinityURLIdentifier =“jsessionid”Name =“/ web / *”/>

or any other way? 或任何其他方式? Thanks in advance. 提前致谢。

I'm nearly positive there is not a way to do this in the plugin configuration file. 我几乎肯定在插件配置文件中没有办法做到这一点。 That file normally simply reflects what you can configure through the administration console, and that Uri element simply reflects the web application's context root. 该文件通常只是反映了您可以通过管理控制台配置的内容,而Uri元素只是反映了Web应用程序的上下文根。 So I'd be very surprised if it supported any kind of powerful, flexible pattern syntax. 如果它支持任何类型的强大,灵活的模式语法,我会感到非常惊讶。

On the other hand, you may be able to accomplish what you want in another way. 另一方面,您可能能够以其他方式完成您想要的任务。 If you have a proxy server in front of WebSphere, you could "block" the path that way. 如果您在WebSphere前面有一个代理服务器,那么您可以“阻塞”该路径。 Or use a Servlet Filter within WebSphere to return a 404 page or whatever other kind of response you want that particular URL to return. 或者在WebSphere中使用Servlet过滤器来返回404页面或您想要返回的特定URL的任何其他类型的响应。 (Including only conditionally returning that error page, base on, say, the Host header, if that's what you really want.) (包括仅有条件地返回该错误页面,例如,基于主机头,如果这是你真正想要的那样。)

You can use mod_rewrite and the [PT] flag to rewrite to a URL that doesn't match the context root. 您可以使用mod_rewrite和[PT]标志重写为与上下文根不匹配的URL。 If you were trying to serve it as a static file, You might also have to add an Alias to make a new fake context root work. 如果您尝试将其作为静态文件提供,则可能还需要添加别名以使新的伪上下文根工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM