Home PageFacebook pageAbout Our ChurchSunday ServicesActivitiesInfo
|
Pm Wiki 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 four basic ways to accomplish this: aliasing, making a "wiki" script, renaming the pmwiki script, or using mod_rewrite. AliasingFirst, 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. You'll then need to set Added by heck@fas.harvard.edu: Using Apache 2.0.x, I also needed to alias the pub directory. The link tags that load the style sheets will now point at e.g. http://example.com/wiki/pub/css/stdlayout.css, but that is aliased to /home/account/www/pmwiki.php/pub/css/stdlayout.css, which makes no sense. The solution is to add another alias: Alias /wiki/pub /home/account/www/pub Note that you can put these directories anywhere: They do not have to be under your DocumentRoot. NOTE (added be tj-AT-web62.com): Tis did not work for me, don´t know why. If I did it like above, the second Alias just triggered a request to the wiki error message 'pub/skins/pmwiki/pmwiki.css' is not a valid PmWiki page name I had to add an Alias /pub /home/account/www/pub to get it work right! It seems that all steps described below only make sense, if in the configuration file of the webserver "AllowOverride None" not is set. All user specific directives are forbidden this way. So what then?? (fhattop@yahoo.de) Making a "wiki" scriptIf 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 thewiki file:
<?php chdir("/path/to/pmwikidir"); include("pmwiki.php"); ?>
In the script, replace
<Files wiki>
SetHandler application/x-httpd-php
</Files>
This tells the webserver to treat the Renaming the pmwiki.php fileA 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, you shouldn'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 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. Using mod_rewriteThe Apache Web server has all kinds of crazy features, one of which is mod_rewrite. The following recipe in an .htaccess file should get your urls looking real real nice:
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Z].*) /path/to/pmwiki/pmwiki.php?pagename=$1 [L,qsappend]
When using mod_rewrite make sure you have all the following set in your local/config.php Getting cleaner URLs out of PmWikiYou have to change your local configuration to get PmWiki itself to generate pretty urls. Setting the $EnablePathInfo variable to 1 will tell PmWiki to make pretty page names with slashes ("/") instead of dots in them, and no "pagename=" stuff. Then, setting << Mail Posts | PmWiki.Documentation Index | CustomInterMaps >> |
|
Page last modified on April 19, 2004, at 12:28 AM
|
|