From 42e9747650c439102e444431d40c47b65ca9f860 Mon Sep 17 00:00:00 2001 From: allo Date: Sun, 25 Feb 2007 20:07:35 +0000 Subject: [PATCH] fixed /path/forwarding. uncomment, if you want to use it. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3398 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- addon/peerForwarding.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/addon/peerForwarding.php b/addon/peerForwarding.php index 1b64aba41..71043781b 100644 --- a/addon/peerForwarding.php +++ b/addon/peerForwarding.php @@ -5,8 +5,8 @@ $page = 'error.html'; $peername = 'Error'; $seedurl = 'http://www.anomic.de/yacy/seed.txt'; // remote seed-file - $seedfile = 'seed.txt'; // local cache file, needs write access - $hostlength = 24; // EDIT THIS! length of the hostname + 1 (strlen(".peer.karlchenofhell.org")) + $seedfile = 'seed.txt'; // local cache file, needs write access + $hostlength = 24; // EDIT THIS! length of the hostname + 1 (strlen(".peer.karlchenofhell.org")) function get($url, $filename) { if(!file_exists($filename) || (time()-filectime($filename)) > 600){ @@ -79,27 +79,27 @@ return $r; } + ###peername.yacypeer.dyndns.org + ###rewrite: + ###RewriteCond %{REQUEST_URI} /error.html + ###RewriteRule ^/(.*) /error.html [L] + ###RewriteRule ^/(.*) /index.php?url=$1 [L] $name = $_SERVER['SERVER_NAME']; $name = substr($name, 0, strlen($name) - $hostlength); + ###domain.org/peername/* + ###rewrite: + ###RewriteRule ^/(.*) /error.html [L] + ###RewriteRule ^/([^\/]*)/(.*) /index.php?name=$1&url=$2 [L] + #$name=$_GET['name']; + $seedfile = get($seedurl, $seedfile); $peers = decodeSeedList($seedfile); $peer = $peers[strtolower($name)]; - #peername.yacypeer.dyndns.org - #rewrite: - #RewriteCond %{REQUEST_URI} /error.html - #RewriteRule ^/(.*) /error.html [L] - #RewriteRule ^/(.*) /index.php?url=$1 [L] - - #$name=$_SERVER['SERVER_NAME']; - #$name=substr($name, 0, strlen($name)-(strlen($basehost)+1)); //+1 because we filter .$basehost - #domain.org/peername/* - #rewrite: - #RewriteRule ^/(.*) /error.html [L] - #RewriteRule ^/([^\/]*)/(.*) /index.php?name=$1&url=$2 [L] + if (strlen($name) == 0 || $peer == null) { // peer-list @@ -142,5 +142,4 @@ \ No newline at end of file + } \ No newline at end of file