问题
I have a client running a WebLogic 11g install on a Windows Server machine who wishes to implement Apache-style mod_rewrite-like functionality to translate requests for http://easyurl.com to http://super.complicated.com/with/this/junk?here=and_more. I have scoured the Internet for advice, but all I can find are other people who are asking the same question and not getting any answer. Assuming that installing 3rd-party apps is not an option, how do I implement this in WebLogic?
Edit: Now that I think about it, this question probably belongs on Server Fault. I'll move it there.
Further edit: https://serverfault.com/questions/177795/url-rewrite-in-weblogic-11g is the Server Fault link.
回答1:
If you are using Apache HTTPD with the Apache HTTP Server Plug-In in front of WebLogic, then it should be possible to use
mod_rewrite
before to send request to WebLogic.If not, then you could use Tuckey's Url Rewrite Filter (a Java Filter) that allows to rewrite URLs in a
mod_rewrite
like manner at the application server level.
回答2:
There is no way to do this out of the box with weblogic. The least invasive is to implement Pascal's suggestion of a url rewrite filter. I had the exact same requirement (implement this with just weblogic, no additional code as it would have to be managed/documented, etc) and there was no way to do this.
回答3:
I would use either PrettyFaces or OCPsoft Rewrite for this. Both are more updated solutions to the URL-rewriting domain:
http://ocpsoft.com/prettyfaces/
http://ocpsoft.com/rewrite/
来源:https://stackoverflow.com/questions/3637147/weblogic-11g-url-rewrite