[pmwiki-users] Clean URLS cookbook question

Scott Brenner Scott.Brenner at oag.state.ny.us
Fri Feb 3 15:43:01 CST 2006


Dear Gang,

On a test apache server I have changed my http.conf file

LoadModule rewrite_module modules/mod_rewrite.so

<Directory "C:/Program Files/Apache Group/Apache2/htdocs/pmwiki">
    AllowOverride All
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>

I then changed my pmwiki local/config.php

$BaseUrl = 'http://'.$_SERVER[HTTP_HOST];
$ScriptUrl = $BaseUrl.'/pmwiki';
$PubDirUrl = $BaseUrl.'/pmwiki/pub';
$EnablePathInfo = 1;
$UploadDir = 'uploads';
$UploadUrlFmt=$BaseUrl.'/pmwiki/uploads';

To make the wiki autoload I added the following  index.php file at
C:/Program Files/Apache Group/Apache2/htdocs/pmwiki
<?php include 'pmwiki/pmwiki.php' ?>

I then added a .htaccess file at C:/Program Files/Apache
Group/Apache2/htdocs/pmwiki

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(^/pmwiki) /pmwiki/pmwiki.php?n=$1 [QSA]

I now almost have clean urls.

URLS look like
http://localhost/pmwiki/?n=Main.HomePage
http://localhost/pmwiki/?n=Main.Page1 
http://localhost/pmwiki/?n=Main.Page2 

When I change the .htaccess file to 
RewriteEngine on
RewriteRule ^(^/pmwiki) /pmwiki/pmwiki.php/$1 [QSA]

the URLS look like
http://localhost/pmwiki/Main/HomePage 
http://localhost/pmwiki/Main/Page1
http://localhost/pmwiki/Main/Page2

The problem is that all 3 URLS display the  Main/HomePage.

Has anyone experienced this problem? 
Does anyone have a suggestion?

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.

Thanks,
Sam Brenner









More information about the pmwiki-users mailing list