Created
March 19, 2014 22:54
-
-
Save SgtPooki/9653153 to your computer and use it in GitHub Desktop.
remove .php
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
# Apache Rewrite Rules | |
<IfModule mod_rewrite.c> | |
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteBase / | |
#RewriteLog /var/rewrite.log RewriteLogLevel 9 | |
# Redirect to URL without extension. (remove .php) | |
RewriteCond %{THE_REQUEST} ^[A-Z]+\s.+\.php\sHTTP/.+ | |
RewriteRule ^(.+)\.php $1 [R=301,L] | |
# Internally attach .php to any requests that | |
# are not a directory or file, so that the correct file is served. | |
RewriteCond %{REQUEST_FILENAME}.php -f | |
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [L] | |
</IfModule> | |
# End of Apache Rewrite Rules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment