Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Friendly URL at the Tomcat level

RichDWMay 10 2019

Apex 5.1
Oracle Express 11g
Apache 2.4
Tomcat 9.0

I am not a guru, but I do follow directions well.  The below configuration was provided to me, although I think I understand what is happening at each 'stop' along the way.  I do not know how to adjust this to make the URL more user-friendly (or if that is even possible). I would like the user to only have to use 'https://application.domain.com' to initiate the session; and I do not care what the URL looks like once the session is underway.

Our DNS routes https web traffic for our apex application to our Apache webserver via the hostname in the url.  Apache is configured to act as a reverse-proxy to forward this https traffic over http to our Tomcat appserver, which hosts our ORDS.war file.

Our full application url:
https://application.domain.com/ords/f?p=101:1

The redirect at the Apache server is set in our httpd-ssl.conf file:
<VirtualHost *:443>
ServerName application.domain.com
SSLEngine on
Header always set X-Frame-Options SAMEORIGIN
# Proxy Rules for redirecting the traffic
ProxyPreserveHost on
RequestHeader unset Origin
ProxyPass / http://10.10.10.10:9090/
ProxyPassReverse / http://10.10.10.10:9090/
</VirtualHost>

So traffic to https://application.domain.com is forwarded to http://10.10.10.10:9090/  (our Tomcat server and port)

The 'context' of /ords/ is what Tomcat is listening for - and when included, this traffic is directed to the Apex database.  The remaining part of the URL (f?p=201:1) is the 'query string' and it also gets forwarded to the Apex engine letting it know which application and page to access.

In order to make the URL more user-friendly, can I add the 'Context' and 'Query string' (/ords/f?101:1) at the Tomcat level; instead of it being part of the original URL?  I would have to redirect all traffic coming into port 9090 to /ords/f?p=101  (the default landing page can be set within the apex builder).

Looking at http://tonyjunkes.com/blog/a-brief-look-at-the-rewrite-valve-in-tomcat-8/ I see Tomcat has it's own built in approach to handling URL rewrite.  I tried to follow his example and added the include for the rewrite valve class in a 'context.xml' file at webapps\apex\WEB-INF and a rewrite.config file in the same directory.

The rewrite directive I've got is supposed to push any /context/querystring to a specific url and tell the webpage to remember the redirect:
RewriteRule ^(.*)$ http://10.10.10.10:9090/apex/f?p=101 [R=301,L]

This is not working... Can anyone assist with this, as I'm out of ideas?

Comments
Post Details
Added on May 10 2019
0 comments
738 views