Creating case-insensitive URLs using htaccess

Possible duplicate:
Case-insensitive urls with mod_rewrite

I need to make the URL case insensitive. This means that I need to work http://www.test.com/about.php and http://www.test.com/about.php .. I tried the code below. But it does not work. Shows the index page.ie, it shows the contents of the index page

 #Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
+3
source share
2 answers

Since then I have found this question that has an accepted answer (copied below for reference):

CheckSpelling on

This seems to be the same (or similar enough) of your situation.

, / , , , , :)

+4

- apache * nix URL-, * nix .

, Apache, .

, .htaccess rewrite:

RewriteRule ^about.php$ About.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]

- (, mod_spelling), URL- .

, index.php $_GET['q'] , , include it return :

$basename = strtolower(basename(realpath($_GET['q'])));
if (is_file($path = __DIR__ . '/' . $basename)) {
    include($path);
    return;
}

.

0

All Articles