Alex
Alex

Reputation: 4473

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;

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/*"/ >

or any other way? Thanks in advance.

Upvotes: 0

Views: 2224

Answers (2)

covener
covener

Reputation: 17896

You can use mod_rewrite and the [PT] flag to rewrite to a URL that doesn't match the context root. 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.

Upvotes: 1

Doug Breaux
Doug Breaux

Reputation: 5115

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. 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. 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. (Including only conditionally returning that error page, base on, say, the Host header, if that's what you really want.)

Upvotes: 1

Related Questions