Forum Moderators: phranque
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule !\.(js|gif|jpg|png|css|txt)$ index.php NC flag has no effect. (.*) matches all requests. NC flag is used when the RegEx pattern is ^page$ and you want to accept any case request. Without the NC flag in place, only example.com/page would match, but with the NC flag added, requests for example.com/Page and example.com/pAgE would also match. NC flag with a rewrite that directly serves content, use it only with a redirect. You should not allow multiple URLs to access the same content, and that's what the NC flag would do when used with a rewrite that serves content. strtolower() to deduce the new URL and the HEADER directive to issue a 301 redirect to the new URL. This is now safe, content is now only served at lower case URLs, and the redirect retains traffic asking for upper case URLs.