Manual:Short URL/wiki/Page title -- Cherokee rewrite--root access
From Linux Web Expert
File:OOjs UI icon clock-destructive.svg | Warning: This Short URL page contains bad advice on how to configure your server that could lead to some pages on your wiki not working and/or may cause you issues while upgrading. |
Example configuration:
- wiki is installed in /w/ directory in the virtual server root directory.
- you want to avoid index.php
- you want to access articles as /wiki/Article
Steps:
- Access
cherokee-admin
interface - Go to Virtual servers section and choose the virtual server you want to edit
- Open Behavior tab
- Click Add new rule and choose type Regular Expression, then write
/wiki/(.+)
inside the Regular expression field - Press enter, open Handler tab and choose type Redirection
- Add a new rule with the following settings:
- Show: Internal
- Regular expression: (leave blank)
- Substitution:
/w/index.php?/$1
- Press enter to accept and go again to the Behavior tab inside your wiki's virtual server
- Click Add new rule and choose type Full Path, then write
/wiki
inside the Full Path field - Press enter and, in Add another path write
/wiki/
- Open Handler tab and choose type Redirection
- Add a new rule with the following settings:
- Show: External
- Regular expression: (leave blank)
- Substitution:
/w/index.php
- Press enter to accept and restart the server
- Edit
LocalSettings.php
and add the following:
$wgScriptPath = "/w";
$wgScript = "$wgScriptPath/index.php";
$wgRedirectScript = "$wgScriptPath/redirect.php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
That's all