From 9a0a36705825cf8f268275487718c312d68d6761 Mon Sep 17 00:00:00 2001 From: Croway Date: Fri, 16 Jan 2026 10:15:18 +0100 Subject: [PATCH] Redirect rule, when the header Accept: text/markdown is set, than redirect to the .md page --- static/.htaccess | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/.htaccess b/static/.htaccess index 2341f55d87e..1ae7247efd7 100644 --- a/static/.htaccess +++ b/static/.htaccess @@ -1,6 +1,12 @@ # Redirect security advisories to new location RewriteEngine on RewriteBase "/" + +# Content negotiation for LLM-friendly Markdown +# When Accept header requests text/markdown, redirect .html to .md +RewriteCond %{HTTP_ACCEPT} text/markdown [NC] +RewriteRule ^(.+)\.html$ /$1.md [R=303,L] + RewriteRule "^security-advisories.data/(.+)$" "security/$1" [R=permanent,L] # Customize what Apache returns to the client in case of an error.