aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-14 15:14:24 +0100
committerTeddy Wing2018-11-14 15:16:25 +0100
commita65fd703de8799a19ad5a878194d0fe07190f4db (patch)
tree9e90c8f935ade141a4026d6917cb85d628416786
parenta9355f139c4960879f1c34a0527bea81ebf29867 (diff)
downloaddome-key-web-a65fd703de8799a19ad5a878194d0fe07190f4db.tar.bz2
.htaccess: Add full FastCGI rewrite rules
Also add some section comments. Here we point /license and /license/download to `license.fcgi`, and /fulfillment to `fulfillment.fcgi`. The actual FastCGI binaries with the `.fcgi` extension get redirected to 404 because we already have nicer-looking URLs for them.
-rw-r--r--.htaccess12
1 files changed, 10 insertions, 2 deletions
diff --git a/.htaccess b/.htaccess
index 81f7116..84a7eaf 100644
--- a/.htaccess
+++ b/.htaccess
@@ -6,13 +6,21 @@ ErrorDocument 404 /404.html
RewriteEngine on
+# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} != on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+# Disallow access to .htaccess
RewriteRule /?\.htaccess$ - [F,L]
-RewriteRule ^(license-generator) license-generator.fcgi [L]
-
+# Remove .html extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.html [L]
+
+# FastCGI routes
+RewriteRule ^(license) license.fcgi [QSA,L]
+RewriteRule ^(license/download) license.fcgi [QSA,L]
+RewriteRule ^(fulfillment) fulfillment.fcgi [QSA,L]
+RewriteRule ^(license.fcgi)$ - [L,R=404]
+RewriteRule ^(fulfillment.fcgi)$ - [L,R=404]