|
|
use with the 404 trickOnce I've implemented a way to run a web server below another one (actually Nanoweb below Apache, for more details see http://nanoweb.si.kz/), because the Apache on one of my providers servers was heavily misconfigured - so I handed work over to a secondary WebServer+. This trick also works without mod_rewrite support, and is therefore also well suited for cheap WebSpace+. Put following into the .htaccess of the dedicated wiki directory: #-- handle "not found" pages by ewiki ErrorDocument+ 404 /wiki/index.php DirectoryIndex+ 404 index.php This will allow the "yoursite.php/ewiki.php" script to catch all missed files, which would usually trigger a 404 error. Inside your ewiki wrapper script, you must then however decode the originally requested URL: $url = $_SERVER["REQUEST_URL"]; # Apache often uses this one $url = preg_replace("#^/wiki#", "", $url); # strip wiki subdir name $_SERVER["PATH_INFO"] = $url; # make ewiki see it The second step is very important, it strips the name of the dedicated subdirectory from the URL, which cannot be done inside ewiki.php. The $url from the above example could also be used as $id parameter to ewiki_page(). It should be noted, that some Apache implementations are garbaging POST requests in case of a triggered 404 error - but you can simply test this by saving a changed WikiPage+. See also the "fragments/404finder.php" example on this. Do not forget to enable EWIKI_USE_PATH_INFO+, as it is per default disabled for Apache servers!prev << "mod_rewrite or PATH_INFO" next >> "Security considerations" You cannot modify the README file, but anyhow any ideas or suggestion should as usually get filed on BugReports, UserSuggestions or even better the README.Discussion. |