[Pmwiki-users] Re: ?pagename= addresses

Chris Lott chris.lott
Mon Dec 20 14:27:40 CST 2004


In case anyone catches this thread in the archives, the solution below
did fix uploads for me with prettier URLs enabled. Thanks!

c

> 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.  :-)



More information about the pmwiki-users mailing list