Adding a URL rewrite to AppWorks Gateway 16.x
originally posted April 11, 2019 | 🕐️ 2 minute read
When upgrading from AppWorks Gateway 1.2.x to 16.x, you may want your users to access your configured services via the same URL as before. This article describes how to use URL rewriting to achieve this.
In AppWorks Gateway 16.x both the Gateway and the Administration Console are accessed via the root context of the Apache Tomcat installation.
This is a change from AppWorks Gateway 1.2.x, where users were taken to /webaccess
from https://[appworksurl]/
, from where they could access the services that were configured there, for example, Tempo Box or Tempo Social.
When upgrading to 16.x, you may want to ensure that users continue to access any configured services with the URL they used prior to the upgrade.
To do this, you can use URL rewriting to perform a URL redirect to the /content
folder.
The following steps describe how to redirect your users from http://host.opentext.com
to http://host.opentext.com/content
by downloading and configuring a Java Web filter for the Apache Tomcat installation.
- Stop the Apache Tomcat service.
- Go to the UrlRewriteFilter web site.
- Click the
urlrewritefilter-4.0.3.jar
link in Step 1 of the Install process. To review the documentation for the Web Filter, click Documentation at the top of the page, then click the link to the 4.0 User Manual. - Save the .jar file to
<Tomcat_Home>/gateway/WEB-INF/lib
. - Add the following to the
<Tomcat_Home>/gateway/WEB-INF/lib/web.xml
file:
<filter> <filter-name>UrlRewriteFilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <async-supported>true</async-supported> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping>
📘 Note: The UrlRewriteFilter
must be the first filter in the web.xml
file.
6. Create a urlrewrite.xml
file in <Tomcat_Home>/gateway/WEB-INF/
, with the following contents:
<urlrewrite> <rule> <name>redirect from root</name> <condition name="host" operator="equal">host.opentext.com</condition> <from>^/$</from> <to type="permanent-redirect" last="true">http://host.opentext.com/content/</to> </rule> </urlrewrite>
7. Start the Apache Tomcat service.
📘 Note: This configuration will redirect from http://host.opentext.com
to http://host.opentext.com/content
, which will mask the Gateway Administration Console. To access the console, the host's IP address, or some other alias must be entered into the browser address bar.
Categories
- All Categories
- 117 Developer Announcements
- 52 Articles
- 146 General Questions
- 136 Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 912 Cloud Fax and Notifications
- 82 Digital Asset Management
- 9.3K Documentum
- 30 eDOCS
- 173 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 6 XM Fax