summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2012-12-31 15:40:30 +0000
committerNathan Kinkade <nath@nkinka.de>2012-12-31 15:40:30 +0000
commit99036791cbd25bb3c3f133a788200c5918742f0f (patch)
treea86e482f975511acb633fa4ea3aa1ad7ed00e6ab
parent0b07d7392c2e269bbc6944cd9ab72900126b9f7c (diff)
Added an .htaccess file to handle new non .php extension URLs
-rw-r--r--.htaccess11
1 files changed, 11 insertions, 0 deletions
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..0dcc4c5
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,11 @@
+RewriteEngine On
+
+# Redirect any requests with .php extensions to non .php URLs
+RewriteRule ^/index\.php(.*) http://dev.nutridb.org/$1 [NE,L,R=301]
+RewriteRule ^/(.*?)\.php(.*)$ http://dev.nutridb.org/$1$2 [NE,L,R=301]
+
+# Get rid of ugly .php extensions
+RewriteCond %{REQUEST_URI} !^/$
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^([^#?]*)(.*)$ /$1.php$2 [L,NE,PT]
+