Last active
December 15, 2015 19:19
-
-
Save grayghostvisuals/5310382 to your computer and use it in GitHub Desktop.
strip the .php extension using .htaccess trickery for Apache
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
| # ------------------------------------------------------ | |
| # strip .php files of file extension | |
| # ------------------------------------------------------ | |
| # rewrite strictly for files ending in .php | |
| # Instead of your sites files as this => domain-name.com/file.php | |
| # Rewrite so users can do this instead => domain-name.com/file | |
| <IfModule mod_rewrite.c> | |
| RewriteCond %{REQUEST_FILENAME}.php -f | |
| RewriteRule ^(.*)$ $1.php [L] | |
| </IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment