[pmwiki-users] Clean url
Joachim Durchholz
jo at durchholz.org
Sat Apr 16 06:17:00 CDT 2005
CB wrote:
> Hello,
>
> I'm trying since several days to apply this cookbook :
> http://pmwiki.org/wiki/Cookbook/CleanUrls
> with apache 2 under windows xp, and pmwiki 2.
>
> My document root is c:\apache\phpweb, and pmwiki is in
> c:\apache\phpweb\pmwiki.
> In config.php, I have :
> $ScriptUrl = 'http://localhost/pmwiki';
> $EnablePathInfo = 1;
>
> 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).
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.
Regards,
Jo
More information about the pmwiki-users
mailing list