summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2022-12-26 15:43:57 -0500
committerAdam T. Carpenter <atc@53hor.net>2022-12-26 15:43:57 -0500
commit4f41d064c9cbf0647e07d012dd538c92648f7a61 (patch)
tree2400a8f5d52b7fb1f394c5e30de59ca6842c8ab9
parent7ac270782d15ec54a3c6f0f74bd4be6f530d04e5 (diff)
downloadwww-4f41d064c9cbf0647e07d012dd538c92648f7a61.tar.xz
www-4f41d064c9cbf0647e07d012dd538c92648f7a61.zip
fix: redirect links to posts/ files to index router
Prevents permalinks on the web from getting pages without nav or CSS (header).
-rw-r--r--usr/local/etc/lighttpd/conf.d/redirect.conf2
-rw-r--r--usr/local/etc/lighttpd/lighttpd.conf1
2 files changed, 3 insertions, 0 deletions
diff --git a/usr/local/etc/lighttpd/conf.d/redirect.conf b/usr/local/etc/lighttpd/conf.d/redirect.conf
new file mode 100644
index 0000000..7b0923c
--- /dev/null
+++ b/usr/local/etc/lighttpd/conf.d/redirect.conf
@@ -0,0 +1,2 @@
+server.modules += ( "mod_redirect" )
+url.redirect = ( "^/posts/(.+).php$" => "/$1" )
diff --git a/usr/local/etc/lighttpd/lighttpd.conf b/usr/local/etc/lighttpd/lighttpd.conf
index 4d98d5b..00c347d 100644
--- a/usr/local/etc/lighttpd/lighttpd.conf
+++ b/usr/local/etc/lighttpd/lighttpd.conf
@@ -4,6 +4,7 @@ include "conf.d/dirlisting.conf"
include "conf.d/mime.conf"
include "conf.d/cgi.conf"
include "conf.d/access.conf"
+include "conf.d/redirect.conf"
index-file.names += ("index.php")
server.error-handler-404 = "/index.php"
server.document-root = "/var/www"