2 If you want nicer URLs (without question marks) for your Wiki, then follow
3 the instructions below on how to set this up with the Apache web server.
9 If you want more beatiful URLs (!http://wiki.example.com/PageName) to all
10 your Wiki pages, you can either use the PathInfoUrls method or leverage the
11 power of the Apache mod_rewrite extension.
13 ==fragments/htaccess== provides an examplary setup. Typically it goes
14 by putting something like this into a .htaccess file near your ewiki
15 script/wrapper installation:
18 #-- let ordinary files pass through
19 RewriteCond %{SCRIPT_FILENAME} !-f
20 RewriteCond %{SCRIPT_FILENAME} !-d
21 RewriteCond %{SCRIPT_FILENAME} !-l
22 #-- every other 'filename' is however treated as page name
23 RewriteRule ^(.+)$ index.php?id=$1 [L,QSA]
25 So then you can set the [EWIKI_SCRIPT] config constant to the right value,
26 using ==define("EWIKI_SCRIPT", "/wiki/");== for example. Please keep in
27 mind, that it should be absolute (a slash in front), because pagenames may
28 contain slashes and action names get prefixed using a slash too.
30 define("EWIKI_SCRIPT", "/wiki/");
31 # define("EWIKI_USE_ACTION_PARAM", 2); // forces ?action= param
32 # define("EWIKI_ACTION_TAKE_ASIS", 0); // in conjunction with this
34 There are more paramters, that you might want/need to tweak (_URLENCODE
35 and EWIKI_DECODE for example). Please refer to the [README.config] on this.
38 virtual /wiki/ directory
39 ------------------------
41 The most reliable approach to get non-ugly URLs for ewiki is to use
42 a fully virtual (= simulated by mod_rewrite) path name to access
45 This example assumes you install ewiki into the DOCUMENT_ROOT
46 of yourserver. You should then put all ewiki files in a directory
47 named "ewiki". Into the .htaccess file of the DOC_ROOT directory
52 RewriteRule ^wiki/(.*)$ ewiki/index.php?id=$1 [QSA,L]
53 RewriteRule ^wiki$ wiki/ [R]
54 #RewriteRule ^wiki$ http://example.com/wiki/ [R=301,L]
57 So all pages can be accessed under the fake ==/wiki/== directory, while
58 ewiki files are actually in ==ewiki/==. The last rule should use the
59 absolute URL preferrably.
61 You then would configure ewiki URL and link generation accordingly in our
62 hypothetic ==ewiki/index.php== script:
65 define("EWIKI_SCRIPT", "/wiki/");
66 define("EWIKI_SCRIPT_URL", "http://www.example.com/wiki/");
67 define("EWIKI_SCRIPT_BINARY", "/ewiki/index.php?binary=");
70 Please note the difference between _SCRIPT and _SCRIPT_BINARY (if
77 Typically ewiki URLs will look like:
79 * ~[/wiki/index.php?id=FrontPage]
80 * ~[/wiki/index.php?id=RecentChanges]
82 If you can't use ModRewriteUrls, then you may wish to set the config
83 constant [EWIKI_SCRIPT] to something like "==/wiki/index.php/==" so you get
84 almost beatiful URLs to all Wiki pages:
86 * ~[/wiki/index.php/FrontPage]
87 * ~[/wiki/index.php/RecentChanges]
89 If you also have the permissions (providers often make this unusable for
90 silly reasons) to override some Apache settings, then you could put
91 "==**Options All +MultiViews**==" into your .htaccess file. This way the
92 URLs would further beautify to;
94 * ~[/wiki/index/FrontPage]
95 * ~[/wiki/index/RecentChanges]
97 Alternatively try to create an Apache .var file (index.var which maps to
98 index.php itself). See the ApacheManual for more informations on this
105 If all of the above sounds still too complicated for you, or mod_rewrite is
106 not available then you could use the following trick to get prettier URLs.
108 Rename your yoursite.php or "index.php" to just "wiki", and create a file
109 called ".htaccess" in the same directory with following content:
112 ForceType application/x-httpd-php
115 This will trick Apache into parsing it as PHP script, even though the file
116 has no extension anymore.
118 Add following to your config.php or above script:
120 define("EWIKI_SCRIPT", "wiki/");
122 This works like the PathInfoUrls or virtual mod_rewrite directory as