Index: wiki.pl
--- wiki.pl.orig	2003-09-11 14:21:02 +0200
+++ wiki.pl	2004-11-07 14:59:31 +0100
@@ -404,6 +404,11 @@
   } else {
     $CGI::DISABLE_UPLOADS = 1;  # no uploads
   }
+  # Modify query string and script path for slashed links
+  if ($SlashLinks && (length($ENV{'PATH_INFO'}) > 1)) {
+    $ENV{'QUERY_STRING'} .= '&' if ($ENV{'QUERY_STRING'});
+    $ENV{'QUERY_STRING'} .= substr($ENV{'PATH_INFO'}, 1);
+  }
   $q = new CGI;
   # Fix some issues with editing UTF8 pages (if charset specified)
   if ($HttpCharset ne '') {
@@ -411,6 +416,11 @@
   }
   $Now = time;                     # Reset in case script is persistent
   $ScriptName = pop(@ScriptPath);  # Name used in links
+  # Fix script name for relative links when slashed page links are used
+  if ($SlashLinks) {
+    my $numberOfSlashes = ($ENV{PATH_INFO} =~ tr[/][/]);
+    $ScriptName = ('../' x $numberOfSlashes) . $ScriptName;
+  }
   $IndexInit = 0;                  # Must be reset for each request
   $InterSiteInit = 0;
   %InterSite = ();
