rewrite extensionless script requests
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 16 Sep 2008 02:49:48 +0000 (02:49 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 16 Sep 2008 03:31:31 +0000 (03:31 +0000)
Apache rewrite rule to redirect /script to *.plp if it exists, so that
digraphs.plp (and other files in the future) can be found at just
/digraphs.  Nobody cares (or should care) about server side file type.

.htaccess

index f8571b4d87da28b0cb23fafb5d78d37a3f52d5f4..f322d756e81f3e949d030d0a4ae6f3b5b8b96fb6 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1 +1,9 @@
 DirectoryIndex index.plp
 DirectoryIndex index.plp
+
+RewriteEngine  on
+RewriteBase    /
+
+# add .plp if a file exists with .plp appended (topdir only)
+RewriteCond    %{REQUEST_FILENAME}.plp  -f
+RewriteRule    ^/*([^/]+)(.*)           $1.plp$2
+