[pmwiki-users] I need help with clean URLs

Patrick R. Michaud pmichaud at pobox.com
Sat Aug 12 18:36:29 CDT 2006

On Sat, Aug 12, 2006 at 03:57:18PM -0700, H. Fox wrote:
> On 8/12/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >On Fri, Aug 11, 2006 at 11:57:29PM -0700, info at theburroughsproject.com 
> >wrote:
> >> Right now my URLs look like this:
> >> www.example.com/pmwiki.php?n=SomeGroup.SomePage
> >>
> >> I want my URLs to look like this:
> >> www.example.com/SomeGroup/SomePage
> >
> >This looks like "Example Three" from the Cookbook.CleanUrls
> >page, so you'll want to follow it.
> Ironically it's more a lot like (more like?) Example One, ".htaccess
> and pmwiki.php in the Same Directory".

Hmmm.  I was thinking it was more like Example Three, because
Example One says:

   After: http://www.example.com/~someuser/pmwiki/Main/HomePage

while Example Three says

   After: http://www.example.com/Main/HomePage

which is obviously a lot closer to what the original poster wanted.
This is a bit reinforced in the list of examples above where it says

       Example One:  http://www.example.com/~someuser/pmwiki/.htaccess
       Example Two:  http://www.example.com/~someuser/.htaccess
     Example Three:  http://www.example.com/.htaccess

where again Example Three appeared closest to desired ultimate result.

> Putting it this way is likely to be confusing for others who might be
> searching the archives.
> The .htaccess file goes in the directory that will be requested, not
> the directory that holds pmwiki.php.  In this instance they happen to
> be the same.

A very valid point -- in describing this particular example it
was simpler to describe it as relative to pmwiki.php, but in
general it's much more correct to say it should go in the directory
of the request.

> When it came time to improve on ~someuser, other alternatives seemed
> even less appealing.  :-|  In the end I just stuck with ~someuser
> because I thought it might actually help experienced administrators
> ("oh I see, it could be installed in a user directory").  This seemed
> worth trading off some possible confusion for an administrator who's
> unfamiliar with user directories.  Using ~someuser could also help
> clarify the difference between "URL paths" and the "filesystem paths".
> We can go ahead and try "just using 'path/to/pmwiki'" instead.  I
> predict that will add confusion, not reduce it.

I totally agree, it still has a lot of potential for (adding) confusing.
I'm just thinking that the case of installing PmWiki into a hosted
environment (sans ~username) is a *lot* more common than using ~username.  

> [snip]
> >Your questions have already pointed out some important gaps
> >in the current documentation, so this is a huge help to us all.
> I'm disappointed to learn that I spent those hours rewriting the
> CleanURLs recipe page only to leave holes and huge gaps.  

Please don't be disappointed; I wasn't intending to imply there
are huge gaps in CleanUrls, my implication was more that the
page has evolved to the point where it requires more specific/
penetrating questions in order to see where potential confusion
lies.  I think that the current CleanUrls page is a huge success,
especially as evidenced by how few questions we now get on the
mailing list about the topic.

> IMHO part of
> the problem here was that the poster installed PmWiki in the web
> docroot directory, which is not necessary and probably not
> advisable.[1]

I thought the same thing at the time of my reply but didn't write it --
preferring to remain focused on the immediate issue.  I totally
agree that it's probably better to install PmWiki in a pmwiki/
subdirectory somewhere, and then use mod_rewrite to make the
urls appear at the server root, for the same reasons you cite
in the CleanUrls note that was added.


More information about the pmwiki-users mailing list