[pmwiki-users] ** Final Solution: Re: lots of problems when redirecting or rewriting URLs
Joachim Durchholz
jo at durchholz.org
Fri Jan 20 08:17:55 CST 2006
DaveG schrieb:
> RewriteCond %{QUERY_STRING} ^$
> RewriteRule ^/?$ Main/HomePage/ [R=permanent,QSA,L]
Um... the RewriteCond turns down requests for URLs like
pmwiki.org/?action=diag
pmwiki.org/?action=edit
I'd remove the RewriteCond.
Or, if the RewriteCond should indeed stay (that's essentially a question
of what you want, not a technical one), you could remove the QSA here
because the RewriteRule isn't going to be invoked with a query string
anyway.
> #index.php resides in the root/top level directory
> RewriteRule ^([^/a-z].*) index.php?n=$1 [QSA,L]
>
> 2] Create an index.php in the root/top level directory, which the rules
> above are redirecting to:
> <?
> php chdir('pmwiki');
> include 'pmwiki.php';
You don't need an index.php if the first RewriteRule is in place and
working. The request will be short-stopped and returned with a 302
status to the browser before Apache even cares to look whether there's
an index.* file in the directory.
HTH
Jo
More information about the pmwiki-users
mailing list