Thursday 22 March 2007

apache: mod_rewrite/mod_proxy vs mod_proxy_html

With the native apache modules, mod_rewrite or mod_proxy, we can change strings in http headers, thus achieve the so-called proxy mechanism on the apache server. However, sometimes the changes of http request headers are not enough.

For example, I have experienced to archive an existing ZWiki site and re-host to another server. On the new server, I thought it would be nice to serve the ZWiki behind the apache server and users access it with a new virtual-host address.

The old ZWiki archive has links some of which can be changed with either mod_rewrite or mod_proxy; some other can not be changed with the apache native modules, however. Because those links are in the raw html pages. The apache modules only manupliate http headers. What can I do?

After a bit googling, I found a nice third-party module, mod_proxy_html, can come to remedy this. It does exactly what it says, changing the served html pages on the fly.

The compilation and linking to apache are very easy once you follow the documentation. The configuration is also a breeze. Arha.

No comments: