This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git


The following commit(s) were added to refs/heads/main by this push:
     new cd918dff chore: .htaccess - serve the Markdown copy of a page only 
when it exists, and llms.txt for the home page (#1810)
cd918dff is described below

commit cd918dff1316c762be74a50252eb1e21dd2bbf4f
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Oct 13 09:38:28 2026 +0200

    chore: .htaccess - serve the Markdown copy of a page only when it exists, 
and llms.txt for the home page (#1810)
    
    * chore: .htaccess - serve the Markdown copy of a page only when it exists, 
and llms.txt for the home page
    
    Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
    
    * chore: .htaccess - explain why a Markdown request for the home page gets 
llms.txt
    
    Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
    
    ---------
    
    Signed-off-by: Claus Ibsen <[email protected]>
    Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
---
 static/.htaccess | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/static/.htaccess b/static/.htaccess
index 910ee699..a1d6b6fa 100644
--- a/static/.htaccess
+++ b/static/.htaccess
@@ -3,8 +3,16 @@ RewriteEngine on
 RewriteBase "/"
 
 # Content negotiation for LLM-friendly Markdown
-# When Accept header requests text/markdown, serve .md instead of .html
+# Coding agents ask for Markdown in the Accept header; Claude Code, for 
example, sends
+# "Accept: text/markdown, text/html, */*" when it fetches a page. An agent 
that opens the
+# home page gets llms.txt, the Markdown index of the documentation, instead of 
the HTML
+# home page, so it finds the docs and their Markdown copies from there.
 RewriteCond %{HTTP_ACCEPT} text/markdown [NC]
+RewriteRule ^index\.html$ llms.txt [L]
+# Any other page is served as its .md copy when it has one; pages without a 
copy stay HTML
+RewriteCond %{HTTP_ACCEPT} text/markdown [NC]
+RewriteCond %{REQUEST_FILENAME} ^(.+)\.html$
+RewriteCond %1.md -f
 RewriteRule ^(.+)\.html$ $1.md [L]
 
 RewriteRule "^security-advisories.data/(.+)$" "security/$1" [R=permanent,L]

Reply via email to