[pmwiki-users] Re: Clean URLs

Joachim Durchholz jo at durchholz.org
Sat Apr 16 14:11:34 CDT 2005


CB wrote:

>> Note that you're working off an old version of the recipe. The
>> current version fixes a few other issues (such as umlauts and
>> accented characters in page names, and displaying the right URL
>> when giving just http://localhost/ in the browser bar).
>> 
> Where are these new rules please ? The one in the beginning of the 
> cookbook ?

The entire page has been reworked. In particular, the rewrite rules have
been revamped, and the old rules were removed.

> I solved (I hope) my problem with the two following rules, in this
> order :
 >
 >   RewriteRule C\:/apache/phpweb/pmwiki pmwiki.php [L]
>   RewriteRule ^([^/a-z].*) pmwiki.php?n=$1 [QSA,L]
 >
> I don't really understand why I need the first rule in this forme,
> but after reading Apache's log(*), It' the only way I get it to work.
> 
> (*) : I saw strange things in the logs, like "GET 
> /pmwiki/?n=C:/apache/phpweb/pmwiki HTTP/1.1" when pointing my browser
> to "http://localhost/pmwiki" ...

A request like "GET /pmwiki/?n=C:/apache/phpweb/pmwiki" Should Not
Happen. I think it's the consequence of some earlier problem.

Did you try to turn rewrite logging on? It has helped me tremendously
when diagnosing similar problems.

The current CleanUrls recipe is unnecessarily complex in one respect. 
The rewrite rule for ^/?$ tries to intercept the "directory index" case, 
which we could equally well let Apache do, by doing something like

   DirectoryIndex pmwiki.php?n=Main.HomePage

I had planned to update the recipe, but I never found the time to 
properly review the Apache docs (to make sure I don't make some silly 
error) and do the testing (to detect whether I made some silly error 
anyway).

DirectoryIndex should handle that case best though. It's intended for 
exactly that situation, it doesn't have funny borderline cases like ^/?$ 
does, and ^/?$ did some strange things that I didn't fully understand so 
I'd love to get rid of it.

Regards,
Jo



More information about the pmwiki-users mailing list