Link to home
Start Free TrialLog in
Avatar of purfus
purfus

asked on

mod_rewrite and mod_speling not working together

I have a site where mod_rewrite is needed for a custom php framework.   The site in question is being transfered from a windows server using ASP to a linux server and will be converted to php.  On the windows server the files could called with case insensitivity.  I'm trying to duplicate this because a lot of links on the site don't match to the exact case of some of the folders or filenames.  (we didn't build the site, we're just tranfering it, and I don't know why the original developer did that.)

I enabled mod_speling but if mod_rewrite is on with our rules, it doesn't work.  If I take out our mod_rewrite rules, then mod_speling works as it's supposed to.  I understand why this happens.  Our rewrite rules have conditions that state that if the REQUEST_FILENAME is not a file or directory then execute the rule.  

I don't know if it's possible, but can mod_speling and mod_rewrite play nice and work together?

Here's the information in our .htaccess file for mod_speling and mod_rewrite.

<IfModule mod_speling.c>
    CheckSpelling On
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
         
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f    
    RewriteRule ^(control)$ admin.php?use=yes [L,NC]
   
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f    
    RewriteRule ^(control/)(.*)$ admin.php?use=yes&url=$2 [L]
   
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ frontend.php?use=yes&url=$1 [L]    
</IfModule>

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial