chiark / gitweb /
Use text/plain for all-caps filenames in .htaccess
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 18 Oct 2025 23:07:51 +0000 (00:07 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 18 Oct 2025 23:07:51 +0000 (00:07 +0100)
There are various text files in the Bedstead sources (and hence on the
Web site) that have conventional names in all caps, like NEWS.  These
should be served as text/plain.  That can be achieved in Apache using
a <FilesMatch> block and ForceType.

.htaccess

index dbc5164f090154a6dcf92ca70675f76b55242598..fa1c09fc82353ef208bef3718998f4f6ebf879f5 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1,5 +1,8 @@
 DirectoryIndex index.xhtml
 AddType application/xhtml+xml;charset=UTF-8 .xhtml
 AddType font/otf;outlines=CFF .otf
+<FilesMatch "^\p{Lu}+$">
+  ForceType text/plain
+</FilesMatch>
 AddOutputFilterByType DEFLATE application/xhtml+xml text/css font/otf \
  text/plain text/x-csrc application/postscript