Ticket #131 (closed defect: fixed)
Wiki names not case sensitive on windows server
| Reported by: | lucas | Owned by: | DotMG |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1.6.2 |
| Component: | core | Version: | 1.1.6.1 |
| Severity: | normal | Keywords: | mod_rewrite, windows, lowercase pagename |
| Cc: |
Description (last modified by DotMG) (diff)
When using the mod_rewrite option, new pages are not stored case sensitive, which makes a new pasge NewPage appear as newpage. The problem is in the .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^\./]*[^/])$ $1/
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</IfModule>
The REQUEST_FILENAME contains only lower case characters on a windows machine. I don't know the solution though.
This only happen on windows machine. This problem cannot be solved in .htaccess, because it is not a syntax bug but an (I suppose) implementation bug of mod_rewrite on Windows. Here is how I fixed that:
if (preg_match("#^(.+?)/(.*)$#", $wakka, $matches)) list(, $page, $method) = $matches;
else if (preg_match("#^(.*)$#", $wakka, $matches)) list(, $page) = $matches;
if ($method)
{
$method = preg_replace('/\..*$/', '', $method);
}
#Fix lowercase mod_rewrite bug: Url rewritting lowercases the page name.
if (strtolower($page) == $page)
{
$pattern = preg_quote($page, '/');
if (preg_match("/($pattern)/i", urldecode($_SERVER['REQUEST_URI']), $match_url))
{
$page = $match_url[1];
}
}
Change History
Note: See
TracTickets for help on using
tickets.