The .tk domain for my Pax Neo-TeX doesn't forward URL paths -- zompower.tk forwards to fzort.org/bi/neo-tech/, but zompower.tk/vote.php won't forward to fzort.org/bi/neo-tech/vote.php. To work around this, I added some PHP at the top of the index page to redirect to the appropriate page if the referrer contains a path to some other page:
<?
$refr = $_SERVER['HTTP_REFERER'];
if (isset($refr)) {
$refrp = parse_url($refr);
$rhost = $refrp['host'];
$rpath = $refrp['path'];
if (($rhost === 'zompower.tk' ||
$rhost === 'www.zompower.tk') &&
$rpath !== '' && $rpath !== '/' && $rpath !== '/index.php') {
$rfrag = $refrp['fragment'];
$rqy = $refrp['query'];
if (isset($rfrag) && $rfrag !== '')
$rfrag = '#' . $rfrag;
else if (isset($rqy) && $rqy !== '')
$rfrag = '#' . $rqy;
header("Location: http://fzort.org/bi/neo-tech" .
$rpath . $rfrag);
}
}
?>
The code also converts query strings (e.g. ?foo) into anchors (e.g. #foo).
This trick may be useful with other forwarding services and web sites as well...
