[pmwiki-users] Clean URLS cookbook question

Patrick R. Michaud pmichaud at pobox.com
Fri Feb 3 15:58:45 CST 2006


On Fri, Feb 03, 2006 at 04:43:01PM -0500, Scott Brenner wrote:
> Options +FollowSymLinks
> RewriteEngine on
> RewriteRule ^(^/pmwiki) /pmwiki/pmwiki.php?n=$1 [QSA]

This rule is almost certainly wrong, as the $1 will match
whatever is in the parentheses (i.e., "/pmwiki"), resulting in
a url of

    /pmwiki/pmwiki.php?n=/pmwiki

PmWiki's getting confused by the '/pmwiki' as a page name
and so you're getting sent to the Main.HomePage.

I notice that Hagan Fox has refactored the 
http://www.pmwiki.org/wiki/Cookbook/CleanUrls page 
(wow, thanks Hagan!), so you might look at that.  (I haven't
had a chance to review it yet, but I know there are a few
changes I'll want to make to it since it doesn't cover a
couple of common cases.)

> Once this works I'm going to have to come up with a new rewrite rule
> that will transform all URLS of
> n=x.y  to /X/Y so I don't interupt service to previous wiki users.

Note that you normally don't have to do this -- i.e., even after
you enable clean urls the ?n=x.y style of urls continue to work.

Pm




More information about the pmwiki-users mailing list