Skip to Main Content

WebLogic apache plugin PathTrim: context root is wrong in serverside generated URLs

David BalažicDec 16 2022 — edited Dec 19 2022

I use the WebLogic apache plug-in to access my webapps.

The config is:

<Location /WLS1/approot>
  WebLogicPort 7003
  SetHandler weblogic-handler
  PathTrim /WLS1

The idea is to have URLs in form https://apache-hostname/WLS1/approot/page.jsp redirected to https://weblogic-hostname:7003/approot/page.jsp
The above works, but redirects and URLs in HTML are wrong, as they are like "/approot/xyz" instead of "/WLS1/approot/xyz" (URLs in HTML/JSP are generated with the c:url JSTL tag, it prepends the context root, but not the "/WLS1" part, as it is unknown to the server).
Is there a way to fix this?
The example in the plugin documentation is similar:

<Location /weblogic>
SetHandler weblogic-handler
PathTrim /weblogic

But it does not mention the above issue.
Help is welcome.
PS: WebLogic is version 10.3.6 , apache is version 2.2

Post Details
Added on Dec 16 2022