Created
June 3, 2014 09:20
-
-
Save bocharsky-bw/8d537a052ddec9b59257 to your computer and use it in GitHub Desktop.
Rewrite all requests to the index.php script, except physical file or folder requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php/?(.*)\s [NC] | |
RewriteRule ^.*$ /%1%2 [R=301,L] | |
# if the requested path and file doesn't directly match a physical file | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# and the requested path and file doesn't directly match a physical folder | |
RewriteCond %{REQUEST_FILENAME} !-d | |
# internally rewrite the request to the index.php script | |
RewriteRule ^.*$ index.php [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment