ktx/docs-site/next.config.mjs
Andrey Avtomonov c7b64379bf docs-site: serve under /ktx and redirect ktx.sh to docs.kaelio.com
- Add Next.js basePath '/ktx' so the docs site mounts under /ktx,
  enabling it to be reverse-proxied by docs.kaelio.com.
- Add host-based redirects so docs.ktx.sh and ktx.sh permanently
  redirect to https://docs.kaelio.com/ktx, making docs.kaelio.com
  the single canonical home for KTX docs.
- Update markdown-preference middleware to be basePath-aware so the
  llms.mdx rewrite still fires on /ktx/docs/* requests.
2026-05-15 02:30:20 +02:00

36 lines
794 B
JavaScript

import { createMDX } from "fumadocs-mdx/next";
const withMDX = createMDX();
/** @type {import('next').NextConfig} */
const config = {
basePath: "/ktx",
async rewrites() {
return [
{
source: "/docs/:path*.md",
destination: "/llms.mdx/docs/:path*",
},
];
},
async redirects() {
return [
{
source: "/:path*",
has: [{ type: "host", value: "docs.ktx.sh" }],
destination: "https://docs.kaelio.com/ktx/:path*",
permanent: true,
basePath: false,
},
{
source: "/:path*",
has: [{ type: "host", value: "ktx.sh" }],
destination: "https://docs.kaelio.com/ktx/:path*",
permanent: true,
basePath: false,
},
];
},
};
export default withMDX(config);