UseModWiki | RecentChanges | Preferences

UseModWikiDocumentation: GlobalVariables : SlashLinks

Introduced in UseModWiki 1.0.

 $SlashLinks   = 0;      # 1 = use script/action links, 0 = script?action

This variable only controls how page links are generated, but doesn't make the script actually interpret them (as one might expect).

Q: How to use $SlashLinks?

copied from WikiBugs/SlashLinksDoNotWork:

The SlashLinks setting is intended to be used together with server-side URL rewriting, like Apache's RewriteRules. (See WikiPatches/URLRewrite for an old patch with sample Apache rules.) I did not document this requirement, however, which led to confusion. If I have time, I will try to add more documentation for the 1.1 release (probably in January 2004). --CliffordAdams

I made changes like the following to use links like example.org/mywiki/StartPage?:

If you $UseConfig then set this in the config file, if not then in the script

 $SlashLinks = 1;
 $FullUrl    = "/mywiki";

Add the hilighted line to the function InitRequest in the script

  $ScriptName = pop(@ScriptPath);  # Name used in links
  $ScriptName = $FullUrl if ($FullUrl ne '');
  $IndexInit = 0;                  # Must be reset for each request

In the configuration file for Apache:

  RewriteEngine On
  RewriteRule ^/mywiki$ /cgi-bin/wiki.pl [PT,L]
  RewriteRule ^/mywiki/(.*)$ /cgi-bin/wiki.pl?$1 [PT,L]

I hope this helps and I've found all the changes again.

WikiPatches/SlashLinks describes a different fix from MichaelBuschbeck.


Would one of you mind awfully explaining how $SlashLinks is used? I know it's for wikipedia-style subdirectory links (site.org/Topic instead of site.org/cgi-bin/wiki.pl?Topic), but I'm having trouble navigating this site and finding explanations of the various variables. --visitor

Explanation of some of the GlobalVariables can be found on pages with the same name as the variable.

UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited November 12, 2007 12:38 am by MarkusLude (diff)