Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Apache 2.4 reverse proxy with URL substitution.
# Turn compression off in order for the Substitute to work.
RequestHeader unset Accept-Encoding "expr=%{REQUEST_URI} =~ m#^/news#"
# http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#examples
ProxyPass /news http://newspaper.ipage.am
ProxyPassReverse /news http://newspaper.ipage.am
Substitute "s|http://newspaper.ipage.am|http://mercatos.net/news|n"
# In order for the substitute module to work we have to add it to the filter chain.
FilterDeclare Substitute
FilterProvider Substitute SUBSTITUTE "%{REQUEST_URI} =~ m#^/news#"
FilterChain +Substitute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment