[pmwiki-users] Alternate Solution to Case-Sensitive URL Problem
Menachem Shapiro
menachem.shapiro at gmail.com
Sun Jan 30 19:29:11 CST 2005
B"H
On Fri, 28 Jan 2005 17:29:14 -0600, Patrick R. Michaud
<pmichaud at pobox.com> wrote:
> On Fri, Jan 28, 2005 at 02:51:39PM -0800, Menachem Shapiro wrote:
>
> > I am running a wiki on a Linux server. The URLs are case sensitive so:
> > http://otterprojectonline.info/pmwiki/Main -> redirect
> > http://otterprojectonline.info/pmwiki/main -> 404 error
> > http://otterprojectonline.info/pmwiki/MAIN -> page not found error
> > all get different results.
> >
> > Is there any way to turn this off and make it that all of the above
> > URLs go to pmwiki/Main ?
>
>
> Next, the second url above -- the one that results in the 404 error --
> is probably due to a RewriteRule only being applied to urls that begin
> with an uppercase letter at that point. Since "main" doesn't begin
> with an uppercase letter, the RewriteRule isn't being applied, and you'll
> get the 404 error because pmwiki never gets called.
>
I am trying to find a way to setup a RewriteRule to automatically change the
first letter of the page to an uppercase. In this case it would change
pmwiki/main to pmwiki/Main (which could in turn get processed by the
other RewriteRule to redirect it to pmwiki.php?p=Main.Homepage).
This would at least help out with the 404 error.
Patrick suggested something like this in my .htaccess:
RewriteEngine on
RewriteCond ${REQUEST_URI} !^/pmwiki/(pub|uploads)/
RewriteRule ^([A-Za-z].*) /pmwiki/pmwiki.php?n=$1 [L,qsappend]
RewriteRule ^$ /pmwiki/pmwiki.php [L,qsappend]
or this:
RewriteEngine on
RewriteCond ${REQUEST_URI} !^(pub|uploads)/
RewriteRule ^([A-Za-z].*) /pmwiki/pmwiki.php?n=$1 [L,qsappend]
RewriteRule ^$ /pmwiki/pmwiki.php [L,qsappend]
By adding the lowercase a-z in the the RewriteRule, it should also
interpret a lowecase main (pmwiki/main) and convert it to pmwiki/Main,
which could then be Rewritten properly (as usual).
The only problem is that this will mess up access to the pub/ and
uploads/ directories, so a RewriteCond needs to be set up to not
change the case of the pub/ and uploads/ directories.
Unfortunately, I don't know enough apache or PHP to get this to work
on my own and the suggestions Patrick gave didn't work for me.
Does anyone have any suggestions?
Thanks,
Menachem
>
> Pm
>
--
Are you interested in using Linux?
Download Libranet 2.8.1 for free and try it out.
http://www.libranet.com/trial_download.html
More information about the pmwiki-users
mailing list