Skip to content

Commit b21cf0b

Browse files
committed
Fix up duplicate URLs in docs sitemap
1 parent da3dd34 commit b21cf0b

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from 'vitepress';
33
export default defineConfig({
44
title: 'AFDocs',
55
description: 'Test your documentation site against the Agent-Friendly Documentation Spec',
6+
cleanUrls: true,
67

78
sitemap: {
89
hostname: 'https://afdocs.dev',

docs/public/.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ RewriteCond %{HTTP_ACCEPT} text/markdown
2222
RewriteCond %{REQUEST_FILENAME}.md -f
2323
RewriteRule ^(.*)$ /log-agent-signal.php?path=$1.md&trigger=content-negotiation [L,QSA]
2424

25+
# 1. Content negotiation — .html URL with .md equivalent
26+
RewriteCond %{HTTP_ACCEPT} text/markdown
27+
RewriteCond %{REQUEST_URI} ^(.*)\.html$
28+
RewriteCond %{DOCUMENT_ROOT}%1.md -f
29+
RewriteRule ^(.*)\.html$ /log-agent-signal.php?path=$1.md&trigger=content-negotiation [L,QSA]
30+
2531
# 2. Direct .md file requests
2632
RewriteCond %{REQUEST_URI} \.md$
2733
RewriteCond %{REQUEST_FILENAME} -f

0 commit comments

Comments
 (0)