The PHP backend downloads the requested page.
It then adds a <base href="http://site.com/" /> to the top of the source (not very standard compliant, I know). This means that any external content at runtime will be loaded from the original site, rather than apolva.co.cc.
Any relative URLs are then rewritten to be the full address, so they won't be broken. (eg. /image.png =>
http://site.com/image.png).
Any links on the same subdomain are then rewritten so that they are bypassed when clicked.
Finally it replaces the survey script URL with a fake one, and modifies some of the survey loading script so that it accepts it.
Finally it removes the <noscript> redirect, so you don't need javascript enabled to visit the page.