cvs: phpweb /error index.php

From: Date: Sat, 23 Mar 2002 10:50:13 +0000
Subject: cvs: phpweb /error index.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-9191@lists.php.net to get a copy of this message
goba Sat Mar 23 05:50:13 2002 EDT Modified files: /phpweb/error index.php Log: Let URL aliases work, like http://php.net/ini Index: phpweb/error/index.php diff -u phpweb/error/index.php:1.37 phpweb/error/index.php:1.38 --- phpweb/error/index.php:1.37 Sat Feb 9 20:41:56 2002 +++ phpweb/error/index.php Sat Mar 23 05:50:12 2002 @@ -62,6 +62,25 @@ if ($uri[0] == "/") $uri = substr($uri,1); +# shortcuts for PHP and manual pages +$uri_aliases = array ( + + # PHP page shortcuts + "download" => "downloads", + "documentation" => "docs", + + # manual shortcuts + "ini" => "configuration", + "install" => "installation", + "intro" => "introduction" + +); + +# if the user typed an aliased URL, transform it +if (isset($uri_aliases[$uri]])) { + $uri = $uri_aliases[$uri]; +} + # handle common page shortcuts, like docs, links, support, etc. if (file_exists("$DOCUMENT_ROOT/$uri.php")) { header("Location: http://$SERVER_NAME/$uri.php"); @@ -74,9 +93,15 @@ if(strchr($uri,'/')) { list($lang,$function) = explode('/',$uri,2); $function = strtolower($function); + + if (isset($uri_aliases[$function]])) { + $function = $uri_aliases[$function]; + } + $lang = strtolower($lang); + } else { - $function = strtolower($uri); + $function = strtolower($uri); } $try = find_manual_page($lang, $function);

« previous php.mirrors (#9191) next »