Here are my rewrite rules:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} "^(.+)\.\d+\.(css|js)$" [NC]
RewriteRule "^.*$" "/%1.%2" [L]
RewriteCond %{THE_REQUEST} "\ /.*index\.php.*\ " [NC]
RewriteRule "^(.*)index\..+$" "/$1" [L,NC,R=301]
RewriteCond %{THE_REQUEST} "\ /[^?]*\?\ "
RewriteRule "^(.*)$" "/$1?" [L,R=301]
Everything works fine (any suggestion to improve performance or for a better regular expression is welcome, one way or another), but I am experiencing a strange situation, and I cannot figure out if this is caused by my rewrite rules or the default Apache behavior. If my URL ends with a "/", I can add as many slashes as I want without rewriting it.
For example, if in my address bar I insert the following:
Http: // [MY-HOST-NAME] ////////////////////////////
All these traits are not removed. And I still see my index.php page. If I insert the following address:
Http: // [MY-HOST-NAME] / Members ///
All of these multiple slashes are not deleted, and I can see my index.php members page. Etc...
- ? !