";var_dump($path,$catchall);exit; foreach($catchall as $catcher) { if(is_file($catcher)) { $pathinfo = basename($path); // the filename in the local directory #print "Using catchall at $catcher with $pathinfo";exit; chdir(dirname($catcher)); require_once($catcher); exit; } } $redirects = array( # old (rel. zu $prefix) => new '#^[ws]s\d\d\d\d#' => 'old/\0', '#^(cacert|private|tmp)#' => 'old/\0', '#^pdf#' => 'src/pdf', # moved the pdf generator system # moved itp/numrel/exahype to itp/exahype '#^numrel/exahype#' => 'exahype', ); $path = str_replace($prefix, '', $path); function testRedirects($redirects) { global $path_without_prefix, $prefix, $path; $newpath = preg_replace(array_keys($redirects), array_values($redirects), $path_without_prefix); return ($newpath != $path) ? ($prefix . $newpath) : false; } function redirect($path) { header("Location: $path"); print "
See $path."; exit; } function show404($furtherdata=array()) { header("Status: 404 Not Found"); include dirname(__FILE__) . '/template.php'; $data = array( 'uri' => $_SERVER['REQUEST_URI'] ); render('404.html', array_merge($furtherdata, $data)); } $newpath = testRedirects($redirects); if($newpath) redirect($newpath); # check if this is a trans-ITP-FIAS problem $transfiles = array_map(function($piece) use ($itpfias) { return "/home/koeppel/public_html/$itpfias/$piece"; }, $path_without_prefix); var_dump($transfiles); // sorry, this is really a 404. show404(); #print "Sorry, 404 in ~koeppel: Konnte "." nicht finden";