From 8d3f9999c33e5c1d23c082890cbafd25b6f2d291 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 6 Mar 2004 21:35:07 +0000 Subject: [PATCH] Use PATH_INFO for prettier default URLs: index.php/Foo instead of index.php?title=Foo --- LocalSettings.sample | 2 +- config/index.php | 3 +-- index.php | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/LocalSettings.sample b/LocalSettings.sample index ad42e31790..3046303351 100644 --- a/LocalSettings.sample +++ b/LocalSettings.sample @@ -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... diff --git a/config/index.php b/config/index.php index e8a0568ae2..93aae64f4d 100644 --- a/config/index.php +++ b/config/index.php @@ -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\"; diff --git a/index.php b/index.php index 838d748fd1..b48f9b8a62 100644 --- 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" ) ); -- 2.20.1