Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache httpd substitute wont work

Tags:

apache

I configured apache httpd to apply substitute. For my eyes it is exactly what the doc says. However it does simply nothing.

What is wrong with it?

<VirtualHost domain:443>
    SSLEngine on
    ....

    ProxyPass /cms/ http://domain2/
    ProxyPassReverse /cms/ http://domain2/
    Substitute "s|div|DIV|ni"
</VirtualHost>

(Apache 2.4.16 on Centos)

like image 644
stefan bachert Avatar asked Sep 16 '15 08:09

stefan bachert


1 Answers

Meanwhile I figured out how to make it work

<VirtualHost domain:443>
    SSLEngine on
    ....
# In some case the following line is neccessary
    RequestHeader unset Accept-Encoding

    <Location /cms >
         ProxyPass http://domain2/
         ProxyPassReverse http://domain2/
         AddOutputFilterByType SUBSTITUTE text/html
         Substitute "s|div|DIV|ni"
    </Location>
</VirtualHost>

I hope this helps others to overcome similar problems.

(We use it to exchange urls from a proxied source, after hard work apache httpd is a great tool ;-))

like image 87
stefan bachert Avatar answered Oct 25 '22 11:10

stefan bachert