Use PATH_INFO for prettier default URLs: index.php/Foo instead of index.php?title=Foo
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 6 Mar 2004 21:35:07 +0000 (21:35 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 6 Mar 2004 21:35:07 +0000 (21:35 +0000)
LocalSettings.sample
config/index.php
index.php

index ad42e31..3046303 100644 (file)
@@ -52,7 +52,7 @@ $wgRedirectScript   = "{$wgScriptPath}/redirect.php";
 # ArticlePath one is especially useful if you want to use
 # mod_redirect to make page-viewing URLs look static.
 #
-$wgArticlePath      = "{$wgScript}?title=$1";
+$wgArticlePath      = "{$wgScript}/$1";
 # $wgArticlePath     = "/wiki/$1"; # Prettier if you're setup for it
 
 ## Normally you don't need to change these once the above are set...
index e8a0568..93aae64 100644 (file)
@@ -592,8 +592,7 @@ if( \$wgCommandLineMode ) {
 \$wgScript           = \"\$wgScriptPath/index.php\";
 \$wgRedirectScript   = \"\$wgScriptPath/redirect.php\";
 
-\$wgArticlePath      = \"\$wgScript?title=\$1\";
-# \$wgArticlePath     = \"\$wgScript/\$1\"; # Prettier if you're setup for it
+\$wgArticlePath      = \"\$wgScript/\$1\";
 
 \$wgStyleSheetPath   = \"\$wgScriptPath/stylesheets\";
 \$wgStyleSheetDirectory = \"\$IP/stylesheets\";
index 838d748..b48f9b8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -29,7 +29,11 @@ OutputPage::setEncodings(); # Not really used yet
 #global $returnto, $diff, $oldid, $curid;
 
 $action = $_REQUEST['action'];
-$title = $_REQUEST['title'];
+if( isset( $_SERVER['PATH_INFO'] ) ) {
+       $title = substr( $_SERVER['PATH_INFO'], 1 );
+} else {
+       $title = $_REQUEST['title'];
+}
 
 # Placeholders in case of DB error
 $wgTitle = Title::newFromText( wfMsg( "badtitle" ) );