My Oracle Support Banner

Replacement of text/html Does Not Work When Using OHS and mod_substitute (Doc ID 2449037.1)

Last updated on AUGUST 21, 2020

Applies to:

Oracle HTTP Server - Version 12.2.1.0.0 and later
Information in this document applies to any platform.

Symptoms

On : 12.2.1 version, Oracle HTTP Server (OHS) with mod_substitute enabled.

Trying to replace text in a response sent from the application through OHS, and it is not working, the text does not get replaced.
 

The issue can be reproduced with the following steps:

 1. Enable the substitute_module and sed_module and httpd.conf modules:

LoadModule substitute_module "$ {PRODUCT_HOME} /modules/mod_substitute.so"


2. Configuration example in the ssl.conf:

<Location /applicationURL/>
  ProxyPass https://<INTERNAL HOSTNAME.DOMAIN>/applicationURL/
  ProxyPassReverse https://<INTERNAL HOSTNAME.DOMAIN>/Enrolamientos/
  SetOutputFilter SUBSTITUTE
        AddOutputFilter SUBSTITUTE text/html
  Substitute "s|<INTERNAL HOSTNAME.DOMAIN>|<EXTERNAL HOSTNAME.DOMAIN>|i"
 </Location>

 

A simple test.html is working on it's own location:

<html>
<body>
helloworld
</body>
</html>

Use this line in configuration:

Substitute "s|helloworld|goodbye|i"

The result is a page that says "goodbye" instead of "helloworld".  

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.