[pmwiki-users] I need help with clean URLs

H. Fox haganfox at users.sourceforge.net
Sat Aug 12 17:57:18 CDT 2006


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:
> > Hello. I'm having a very difficult time getting clean URLs. I have my
> > pmwiki.php file and all of the folders in my main directory.
> >
> > 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
> >
> > And I'd like, if possible, for the Main.HomePage URL to just be:
> > www.example.com/
>
> 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".

> First, let's get www.example.com/ to work for your Main.HomePage.
> Create a file called 'index.php' in the same directory as pmwiki.php,
> in that file place the line:
>
>     <?php include_once('pmwiki.php');

This step is not necessary.

> Okay, now for the rest of the clean urls.  Create a file called
> '.htaccess' in the same directory as pmwiki.php

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.

[snip]
> > For example, whenever it mentions "~someuser", is that the same as
> > saying "somefolder"? Or is there a significance with the "~" and the
> > term "user"? What's a "user" in this context?
>
> Aha, you've found a hole of sorts in the CleanUrls description.
> CleanUrls was written from the perspective of someone having
> installed PmWiki into a per-user directory on a server, where
> urls all tend to begin with the user's name.  But your situation
> is running PmWiki from the document root directory, or from
> a place that isn't associated with the server's user accounts.
> In fact, I'd tend to think that your situation is the more common
> one.
>
> So, perhaps what we need to do is to eliminate the "~someuser"
> references and just use "path/to/pmwiki" instead, so that
> the administrator understands to simply replace that component
> of the path (without any reference to "~someuser").
>
> Any comments from the group?

This "hole" of using "~someuser" as the URL path and
"/home/someuser/public_html" as the filesystem path didn't seem
optimal when I originally rewrote the CleanUrls page; those were
originally chosen because I used a user account on my server when I
tediously tested and refined the various examples.

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.

[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.  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]

Hagan

[1] I added a note to that effect on the CleanUrls page.  Please
delete or correct the note if it's improper advice.
    http://www.pmwiki.org/wiki/Cookbook/CleanUrls#docroot_note




More information about the pmwiki-users mailing list