[pmwiki-users] Rewrite Rule Question

Patrick R. Michaud pmichaud at pobox.com
Mon Aug 14 13:36:27 CDT 2006


On Mon, Aug 14, 2006 at 05:47:43PM +0200, Tom wrote:
> Hi,
> 
> Patrick R. Michaud schrieb am 14.08.2006 17:34 Uhr:
> > Ouch.  You may need to eliminate more than just the cgi-bin/
> > directory from processing -- otherwise, how will browsers ever
> > access skin files and other items in pub/ ?
> 
> Actually everything else works like a charm (having the NotSoSimple Skin
> btw)
> 
> >     RewriteEngine On
> >     RewriteBase /
> >     RewriteCond ${REQUEST_URI}  !^cgi-bin
> >     RewriteRule ^$           /pmwiki/pmwiki.php  [L]
> >     RewriteRule ^([a-z].*) /pmwiki/pmwiki.php?n=$1  [NC,QSA,L]
> > 
> > The RewriteCond line says to exclude any urls that begin with 
> > cgi-bin from being rewritten.  
> 
> While this reads very good, and after reading about RewriteCond, this
> should work, but it doesn't :(

Oh, I got the syntax wrong.  The RewriteCond line needs to be
either

    RewriteCond %{REQUEST_URI} !^cgi-bin

or

    RewriteCond %{REQUEST_URI} !^/cgi-bin/

The latter may be the correct one because IIUC, REQUEST_URI
isn't modified by the rewriting rules or RewriteBase when being
tested.

Thanks,

Pm




More information about the pmwiki-users mailing list