Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This article needs to be cleaned up.

The goal was to change all rendered html downstream from www.breakitdown.ca to www.supernaturalz.com.

Server Base URL Problem

This at least works in loading up the website, same issue with large images and most likely a host of other problems.

ProxyHTMLURLMap

Ok so ProxyHTMLURLMap does not work easily. The documentation searching in google is sub par and the examples do not seem to work.

I never got ProxyHTMLURLMap working. I have a feeling it's because I never used the Location directive. Anyway will try again at a later date.

Further to that it uses a SAX parser which implies that it expects good xml. I imagine the overhead to be quite high.

substitute

Looking around I found the substitue directive.

sudo a2enmod substitute

<Location /wiki/>
AddOutputFilterByType SUBSTITUTE text/html
Substitute s/www.breakitdown.ca/www.supernaturalz.com/ni
</Location>

And that did it!

Have not measured the performance hit yet.

mod_filter

Just noticed that AddOutputFilterByType is deprecated and it is recommended to use mod_filter. So enable it using a2enmod filter.

Note this is Apache 2.2 syntax. Apache 2.3 has a new style of syntax.

<Location /wiki/>
    FilterDeclare filter_string_replace
    FilterProvider filter_string_replace SUBSTITUTE resp=Content-Type $text/
    Substitute "s/www.breakitdown.ca/www.myrapham.com/ni"
    Substitute "s/Break It Down/www.myrapham.com/n"
    FilterChain filter_string_replace
</Location>

This works!

The resp=Content-Type part does not quite sit well with me as the start does not indicae a regular expression match and then it uses the $ symbol.

References

http://brian.moonspot.net/mod-substitute-mod-proxy-problem - working example of multiple filters and the syntax is slightly different

  • No labels