[Pmwiki-users] Re: ?pagename= addresses

Patrick R. Michaud pmichaud
Tue Dec 14 15:57:54 CST 2004


On Tue, Dec 14, 2004 at 09:15:26AM -0900, Chris Lott wrote:
> > I'm actually working on this one a bit -- will let you know when I
> > have more (later today or early tomorrow).
> 
> Just bringing this one up for air (unless I missed it)-- I'd really
> like to figure this out (if  possible) before my faculty users get
> rolling and external links start getting made into their wikis...

You didn't miss it -- it just took me an extra couple of days to
handle it.  There's a bug in beta8 (and earlier versions) that
keeps URL rewriting from working on uploads -- now fixed in beta9 
(just released).

Here's what I did to make it work:

1.  Upgrade to beta 9
2.  Use the following rules in the .htaccess file

    RewriteEngine on
    RewriteRule ^([A-Z].*) /work/pmwiki/pmwiki.php?n=$1 [L,qsappend]
    RewriteRule ^$ /work/pmwiki/pmwiki.php [L,qsappend]

    The first rule causes anything beginning with a capital letter to
    be passed along as the pagename; the second rule causes an empty
    path to be forwarded to pmwiki.php.  Thus:
        http://www.pmwiki.org/work/pmwiki/Main/HomePage
    becomes
        http://www.pmwiki.org/work/pmwiki/pmwiki.php?n=Main/HomePage
    and 
        http://www.pmwiki.org/work/pmwiki
    becomes
        http://www.pmwiki.org/work/pmwiki/pmwiki.php

3.  Set the following variables in config.php

    $EnablePathInfo = 1;
    $EnableUpload = 1;
    $DefaultPasswords['upload'] = crypt('secret');
    $ScriptUrl = 'http://www.pmwiki.org/work/pmwiki';
    $PubDirUrl = 'http://www.pmwiki.org/work/pmwiki/pub';
    $UploadUrlFmt = 'http://www.pmwiki.org/work/pmwiki/uploads';

    Here $ScriptUrl must be the url of the directory containing the
    .htaccess file, $PubDirUrl is the url of pmwiki's pub/ directory,
    and $UploadUrlFmt is the url of pmwiki's uploads/ directory.

All of this will be coming to a Cookbook recipe soon.  :-)

Pm




More information about the pmwiki-users mailing list