Files
kb-anhonesthost/public/.htaccess
Josh aeb033bae5
All checks were successful
Build and deploy / deploy (push) Successful in 23s
feat(routing): redirect section landings + harden 404 / no directory listings
- astro.config.mjs: section-only URLs now redirect to the first article in
  that section. /whp/admin/ used to render Apache's directory listing
  because no index.html existed; now it serves a meta-refresh to
  /whp/admin/overview/. Same for /whp/, /whp/getting-started/,
  /whp/how-to/, /whp/site-builder/, /whp/reference/, /whp/add-ons/.
- public/.htaccess: ships in dist, disables Options Indexes + MultiViews
  (defense in depth so any future section without a redirect doesn't
  leak a listing), and routes 404/403 to /404.html.
- src/content/docs/404.md: replaces the bare 'check the URL' tagline
  with two explicit actions — 'Go to the knowledge base home' and
  'WHP getting started'.
2026-05-18 11:18:35 -07:00

16 lines
624 B
ApacheConf

# Static-HTML site hardening for kb.anhonesthost.com.
# Lands in dist/ at build time and is uploaded with the rest of the site.
# Never expose a directory listing to visitors.
Options -Indexes
# Astro emits both /path/ (with index.html) and /path.html for every route.
# Default to the trailing-slash form; Apache MultiViews can sometimes serve
# /path.html for /path/, which Pagefind doesn't index — disable it.
Options -MultiViews
# Send anything that doesn't resolve to a file to /404.html.
# Starlight builds a real 404 page; this just makes Apache serve it.
ErrorDocument 404 /404.html
ErrorDocument 403 /404.html