[pmwiki-users] Re: Clean URLs

CB chrisbar at wanadoo.fr
Sat Apr 16 11:31:25 CDT 2005

>>> URLs rewriting goes well, excepted for the root url 
>>> (http://localhost/pmwiki), wich is alway transformed in 
>>> http://localhost/pmwiki/Phpweb/Pmwiki.
>>> The only way I found to prevent that is to install pmwiki directly 
>>> in the c:\apache\phpweb directory.
>>> I'm using that in my .htaccess file, in  :
>>>  AcceptPathInfo On
>>>  Options +FollowSymLinks
>>>  RewriteEngine on
>>>  RewriteRule ^([A-Z].*) pmwiki.php?n=$1 [L,qsappend]
>>>  RewriteRule ^$ pmwiki.php [L,qsappend]
>>> and I have a index.html file with <?php include 'pmwiki.php'; ?>.
> I think it's the last rewrite rule. I had the same situation, and IIRC 
> Apache would give me a "/" instead of a "" if the script was in the 
> root of the document tree. My rewrite rule then read
>   RewriteRule ^/?$ ...
> instead of
>   RewriteRule ^$
> and things have been working fine for me.
> 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 ?

> If you find any problems with that, feel free to ask again - I have 
> tested the updated recipe for myself, but there might still be issues 
> left.

Thanks for your help.
But even with ^/?$ it doesn't work better.
I suspect it's related to windows XP environnement, and it's naming 
conventions, but now I have no more linux box to test that.

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" ...


More information about the pmwiki-users mailing list