Created
May 8, 2015 02:21
-
-
Save kneipp/3d206db99de9dd69f2c2 to your computer and use it in GitHub Desktop.
htaccess removing php extension keeping query string
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
# http://stackoverflow.com/questions/19050516/combine-htaccess-rules-remove-extension-and-rewrite-url-variables?rq=1 | |
Options +FollowSymLinks -Indexes -MultiViews | |
RewriteEngine On | |
RewriteBase /subdirectory | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^([^/]+)/$ $1 [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^([^/]+)/?(.*)$ $1.php?_url=$2 [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment