Created
March 21, 2011 01:35
-
-
Save jedmund/878885 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
AddType x-mapp-php5 .php | |
RewriteEngine On | |
RewriteBase /admin | |
# remove .php; use THE_REQUEST to prevent infinite loops | |
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP | |
RewriteRule (.*)\.php$ $1 [R=301] | |
# remove index | |
RewriteRule (.*)/index$ $1/ [R=301] | |
# remove slash if not directory | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} /$ | |
RewriteRule (.*)/ $1 [R=301] | |
# add .php to access file, but don't redirect | |
RewriteCond %{REQUEST_FILENAME}.php -f | |
RewriteCond %{REQUEST_URI} !/$ | |
RewriteRule (.*) $1\.php [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment