Alnitawk   PmWiki /
ChangePmWikiURL
SearchWiki
PmWiki.RecentChanges
Edit Page
Page Revisions

PmWiki is designed to be usable as a web site maintenance tool, and frequently administrators will want to be able to provide access to PmWiki pages without having "pmwiki.php" appear in the address bar of the users' browser windows. This page describes ways to have your PmWiki installation appear as a URL other than that of the pmwiki.php script itself. The examples below assume that a URL such as http://www.example.com/wiki is being set to refer to pmwiki.php on the www.example.com website.

There are three basic ways to accomplish this. First, if you have access to the web server configuration file, then simply adding the line

        Alias /wiki /path/to/pmwiki.php
to the configuration file will perform the alias for you. In some cases (for instance Apache 2.0) you might be forced to use the full path to pmwiki.php, i.e.
        Alias /wiki /home/account/www/pmwiki.php
even when you've already defined the documentroot as /home/account/www.

This broke the ability to upload images. That is, the upload worked, but the page referencing the image couldn't find it (because the $ScriptPath formed by the alias doesn't find the /uploads directory).

If you don't have access to the configuration file, then a little bit of redirection is needed. First, create a file (not a directory) called "wiki" at the location where the webserver would normally access the "/wiki" URL. Often this is the web server's DocumentRoot directory, but it really depends on your site's configuration. Place the following PHP script in the wiki file:

        <?php chdir("/path/to/pmwikidir"); include("pmwiki.php"); ?>
In the script, replace /path/to/pmwikidir with the name of the directory containing pmwiki.php. Then, add the following lines to the .htaccess file in the same directory as the wiki file (create the .htaccess file if doesn't exist):
        <Files wiki>
        SetHandler application/x-httpd-php
        </Files>
This tells the webserver to treat the wiki file as a PHP script even though it doesn't end in .php. Now, requests for your wiki file will cause the web server to change to the directory containing pmwiki.php and execute it from there. Make sure $ScriptUrl in local.php is pointing at the wiki file, and not at the directory containing pmwiki.php.

A third method is to just rename "pmwiki.php" to a more suitable name, for instance "do.php". If you're going to use the webalizer web log analysis, please don't rename "pmwiki.php" to "index.php". Webalizer 'strips' urls after the 'index.' part, thus effectively destroying all page referrals. For instance: access to '/index.php/Main/Abc' and '/index.php/Main/Xyz' are both referred to as '/', with two counts.

If you want pmwiki to load automatically when you type in a URL that ends in a directory, you can do one of two things. If you can use the Alias directive in your web server configuration file, simply use the Alias directive described above. If you cannot do so, try adding the following to the .htaccess file in the pmwiki directory:

        DirectoryIndex pmwiki.php
This causes pmwiki.php to be loaded by default instead of index.php or index.html, and obscures the filename, at least for first-time visitors.


I'm hosted on http://www.ovh.com and I've just copied the files into the root (www folder) and renamed pmwiki.php to wiki.php and now I can I access my wiki with a pretty url like http://www.example.com/wiki .
And if you rename wiki.php index.php, you have even a simplier url: http://www.example.com

<< LocalCustomizations | PmWiki.DocumentationIndex | CustomHeadersAndFooters >>


Edit Page - Page Revisions - WikiHelp - SearchWiki - RecentChanges
Page last modified on December 28, 2003, at 08:57 AM