diff --git a/README.md b/README.md
index 3d571925a4..8c76745284 100644
--- a/README.md
+++ b/README.md
@@ -32,10 +32,16 @@
- [Screenshots and videos](#screenshots-and-videos)
- [Compressing images](#compressing-images)
- [Recording and compressing videos](#recording-and-compressing-videos)
+ - [Ory Console](#ory-console)
+ - [Navigate to Ory Console Pages](#navigate-to-ory-console-pages)
- [Testing](#testing)
- [Formatting documentation](#formatting-documentation)
- [Adding content to "Examples" page](#adding-content-to-examples-page)
- [CLI and API reference - auto-generated content](#cli-and-api-reference---auto-generated-content)
+ - [CanonicalURL](#canonicalurl)
+ - [When to use CanonicalURL](#when-to-use-canonicalurl)
+ - [How to use CanonicalURL](#how-to-use-canonicalurl)
+ - [How to verify CanonicalURL is working](#how-to-verify-canonicalurl-is-working)
@@ -540,3 +546,61 @@ The `cmd/clidoc/main.go` is the general path for all Ory projects.
The command to generate the CLI docs can be found here:
https://github.com/ory/x/blob/master/clidoc/generate.go#L96
+
+## CanonicalURL
+
+The `CanonicalURL` component specifies the authoritative URL for a page to
+search engines. Docusaurus adds trailing slashes to `index.mdx` files and files
+matching their parent directory names before Vercel's trailing slash removal
+takes effect. This means search engines can crawl both versions (with and
+without trailing slashes). The component ensures search engines know which
+version is canonical by explicitly setting a URL without a trailing slash.
+
+### When to use CanonicalURL
+
+Use this component on:
+
+- **Any `index.mdx` file**: These files serve content at their parent path
+ (e.g., `/api/index.mdx`)
+- **Files matching parent directory names**: When a file shares its parent
+ directory's name (e.g., `docs/kratos/organizations/organizations.mdx`)
+
+Common examples include:
+
+- Index Path (`/api/index.mdx`, `/elements/index.mdx`, `/identities/index.mdx`)
+- Matching parent directory names
+ (`docs/kratos/organizations/organizations.mdx`,
+ `docs/self-hosted/oel/monitoring/monitoring.mdx`)
+
+### How to use CanonicalURL
+
+Add the component at the beginning of your MDX file after the front matter:
+
+````md
+---
+id: your-page-id
+title: Your Page Title
+---
+
+```mdx-code-block
+import CanonicalURL from "@site/src/components/CanonicalUrl"
+
+
+
+Your content here...
+```
+````
+
+### How to verify CanonicalURL is working
+
+1. Open the page in your browser
+2. Right-click and select "View Page Source" (not "Inspect")
+3. Search for `
+```
diff --git a/docs/account-experience/index.mdx b/docs/account-experience/index.mdx
index 8827e3ef2d..2e35e565f4 100644
--- a/docs/account-experience/index.mdx
+++ b/docs/account-experience/index.mdx
@@ -4,6 +4,12 @@ title: Account Experience Overview
sidebar_label: Account Experience
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
The Ory Account Experience is the default user interface for all self-service screens like login, registration, or consent. It can
be accessed under `https://your-slug.projects.oryapis.com/ui`. New Ory Network projects are automatically configured to use the
Account Experience. You can find various customizations and settings in the Ory Console under `Account Experience`.
diff --git a/docs/api/index.mdx b/docs/api/index.mdx
index 9a04434068..ee68f4e060 100644
--- a/docs/api/index.mdx
+++ b/docs/api/index.mdx
@@ -6,8 +6,10 @@ sidebar_label: APIs
```mdx-code-block
import ApiTypes from './_common/api-types.mdx'
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
```
## REST API
diff --git a/docs/elements/index.mdx b/docs/elements/index.mdx
index 8ad1988df1..b2b1c67aca 100644
--- a/docs/elements/index.mdx
+++ b/docs/elements/index.mdx
@@ -3,6 +3,12 @@ id: index
title: Ory Elements Introduction
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
import WelcomePageSection from "@site/src/components/Welcome/welcome"
import { elements } from "@site/src/pages/_assets/welcome-content"
import { elementsArchitectureGraph } from "@site/src/pages/_assets/ui-graphs"
diff --git a/docs/elements/reference/@ory/elements-react/index.md b/docs/elements/reference/@ory/elements-react/index.mdx
similarity index 95%
rename from docs/elements/reference/@ory/elements-react/index.md
rename to docs/elements/reference/@ory/elements-react/index.mdx
index 79ada07e61..8c52069bca 100644
--- a/docs/elements/reference/@ory/elements-react/index.md
+++ b/docs/elements/reference/@ory/elements-react/index.mdx
@@ -1,3 +1,15 @@
+---
+id: index
+title: "@ory/elements-react"
+sidebar_label: "@ory/elements-react"
+---
+
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# @ory/elements-react
This package provides the core functionality for Ory Elements in React.
diff --git a/docs/elements/reference/@ory/elements-react/theme/index.md b/docs/elements/reference/@ory/elements-react/theme/index.mdx
similarity index 81%
rename from docs/elements/reference/@ory/elements-react/theme/index.md
rename to docs/elements/reference/@ory/elements-react/theme/index.mdx
index 46039ad022..a33b634d35 100644
--- a/docs/elements/reference/@ory/elements-react/theme/index.md
+++ b/docs/elements/reference/@ory/elements-react/theme/index.mdx
@@ -1,3 +1,15 @@
+---
+id: index
+title: "@ory/elements-react/theme"
+sidebar_label: "theme"
+---
+
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# @ory/elements-react/theme
This package provides the default theme for Ory Elements React.
diff --git a/docs/elements/reference/@ory/nextjs/app/index.md b/docs/elements/reference/@ory/nextjs/app/index.mdx
similarity index 70%
rename from docs/elements/reference/@ory/nextjs/app/index.md
rename to docs/elements/reference/@ory/nextjs/app/index.mdx
index 83153913f5..dbf3560f5c 100644
--- a/docs/elements/reference/@ory/nextjs/app/index.md
+++ b/docs/elements/reference/@ory/nextjs/app/index.mdx
@@ -1,3 +1,15 @@
+---
+id: index
+title: "@ory/nextjs/app"
+sidebar_label: "app"
+---
+
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# @ory/nextjs/app
## Interfaces
diff --git a/docs/elements/reference/@ory/nextjs/middleware/index.md b/docs/elements/reference/@ory/nextjs/middleware/index.md
deleted file mode 100644
index b7b31f1b12..0000000000
--- a/docs/elements/reference/@ory/nextjs/middleware/index.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# @ory/nextjs/middleware
-
-## Functions
-
-- [createOryMiddleware](functions/createOryMiddleware.md)
diff --git a/docs/elements/reference/@ory/nextjs/middleware/index.mdx b/docs/elements/reference/@ory/nextjs/middleware/index.mdx
new file mode 100644
index 0000000000..109bce2b50
--- /dev/null
+++ b/docs/elements/reference/@ory/nextjs/middleware/index.mdx
@@ -0,0 +1,17 @@
+---
+id: index
+title: "@ory/nextjs/middleware"
+sidebar_label: "middleware"
+---
+
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
+# @ory/nextjs/middleware
+
+## Functions
+
+- [createOryMiddleware](functions/createOryMiddleware.md)
diff --git a/docs/elements/reference/@ory/nextjs/pages/index.md b/docs/elements/reference/@ory/nextjs/pages/index.mdx
similarity index 60%
rename from docs/elements/reference/@ory/nextjs/pages/index.md
rename to docs/elements/reference/@ory/nextjs/pages/index.mdx
index fe13403be7..604f5f9dc9 100644
--- a/docs/elements/reference/@ory/nextjs/pages/index.md
+++ b/docs/elements/reference/@ory/nextjs/pages/index.mdx
@@ -1,3 +1,15 @@
+---
+id: index
+title: "@ory/nextjs/pages"
+sidebar_label: "pages"
+---
+
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# @ory/nextjs/pages
## Hooks
diff --git a/docs/elements/reference/index.md b/docs/elements/reference/index.md
deleted file mode 100644
index a49e32891e..0000000000
--- a/docs/elements/reference/index.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Ory Elements Reference
-
-## Modules
-
-- [@ory/elements-react](@ory/elements-react/index.md)
-- [@ory/elements-react/theme](@ory/elements-react/theme/index.md)
-- [@ory/nextjs/app](@ory/nextjs/app/index.md)
-- [@ory/nextjs/middleware](@ory/nextjs/middleware/index.md)
-- [@ory/nextjs/pages](@ory/nextjs/pages/index.md)
diff --git a/docs/elements/reference/index.mdx b/docs/elements/reference/index.mdx
new file mode 100644
index 0000000000..e77a184d91
--- /dev/null
+++ b/docs/elements/reference/index.mdx
@@ -0,0 +1,21 @@
+---
+id: index
+title: Ory Elements Reference
+sidebar_label: Reference
+---
+
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
+# Ory Elements Reference
+
+## Modules
+
+- [@ory/elements-react](@ory/elements-react/index.mdx)
+- [@ory/elements-react/theme](@ory/elements-react/theme/index.mdx)
+- [@ory/nextjs/app](@ory/nextjs/app/index.mdx)
+- [@ory/nextjs/middleware](@ory/nextjs/middleware/index.mdx)
+- [@ory/nextjs/pages](@ory/nextjs/pages/index.mdx)
diff --git a/docs/hydra/self-hosted/deploy-hydra-example.mdx b/docs/hydra/self-hosted/deploy-hydra-example.mdx
index 3b8a686975..4828a1c124 100644
--- a/docs/hydra/self-hosted/deploy-hydra-example.mdx
+++ b/docs/hydra/self-hosted/deploy-hydra-example.mdx
@@ -477,4 +477,4 @@ server {
- Read the [Prepare for production](./production).
- Fork the [Ory Hydra Node.js UI Reference](https://github.com/ory/hydra-login-consent-node) or
[build a custom UI in the language of your choice](../sdk/01_overview.md).
-- [Add Identity and Account Management](../../identities/index.md)
+- [Add Identity and Account Management](../../identities/index.mdx)
diff --git a/docs/identities/get-started/index.mdx b/docs/identities/get-started/index.mdx
index a3e3eb6a37..035e806912 100644
--- a/docs/identities/get-started/index.mdx
+++ b/docs/identities/get-started/index.mdx
@@ -4,6 +4,12 @@ title: Identity management guide - Day 1 essentials
sidebar_label: Overview
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# Identity management guide
This guide shows how to implement basic authentication flows with Ory. It covers the essential setup and implementation details
diff --git a/docs/identities/index.md b/docs/identities/index.mdx
similarity index 98%
rename from docs/identities/index.md
rename to docs/identities/index.mdx
index 0e7ab6fcae..a19eef3c3b 100644
--- a/docs/identities/index.md
+++ b/docs/identities/index.mdx
@@ -4,6 +4,12 @@ title: Introduction to Ory Kratos Identities
sidebar_label: Introduction
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
Ory Kratos Identities is an API-first identity and user management system built on top of the widely deployed open-source
[Ory Kratos](https://github.com/ory/kratos) following
[cloud architecture best practices](ecosystem/software-architecture-philosophy.mdx). It implements mechanisms that allow handling
diff --git a/docs/keto/index.md b/docs/keto/index.mdx
similarity index 97%
rename from docs/keto/index.md
rename to docs/keto/index.mdx
index 52938ca74c..524a9072b0 100644
--- a/docs/keto/index.md
+++ b/docs/keto/index.mdx
@@ -4,6 +4,12 @@ title: Introduction to Ory Keto Permissions
sidebar_label: Introduction
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
Ory Permissions is a modern permission system you can use to create a complete authorization system for your application or
website, no matter the size or the complexity of the ACLs (access-control lists) your use case requires. Ory Permissions, based on
the open-source Ory Keto Permission Server, is the first open-source implementation of the design principles and specifications
diff --git a/docs/kratos/organizations/organizations.mdx b/docs/kratos/organizations/organizations.mdx
index 52d7951a9a..5efb47df9f 100644
--- a/docs/kratos/organizations/organizations.mdx
+++ b/docs/kratos/organizations/organizations.mdx
@@ -3,6 +3,12 @@ id: organizations
title: B2B SSO & SAML
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# B2B Single Sign-On & SAML
```mdx-code-block
diff --git a/docs/kratos/social-signin/09_ory.mdx b/docs/kratos/social-signin/09_ory.mdx
index 8c726a044d..3942847ad8 100644
--- a/docs/kratos/social-signin/09_ory.mdx
+++ b/docs/kratos/social-signin/09_ory.mdx
@@ -6,7 +6,7 @@ sidebar_label: Ory
# Ory
-This document explains how to add [Ory OAuth2](../../oauth2-oidc/index.md) as an OIDC provider to your Ory Network project.
+This document explains how to add [Ory OAuth2](../../oauth2-oidc/index.mdx) as an OIDC provider to your Ory Network project.
The setup we will describe here is as follows:
diff --git a/docs/migrate-to-ory/index.mdx b/docs/migrate-to-ory/index.mdx
index ff0e8e77dd..b292c4fb38 100644
--- a/docs/migrate-to-ory/index.mdx
+++ b/docs/migrate-to-ory/index.mdx
@@ -5,6 +5,12 @@ sidebar_label: Migrate to Ory
sidebar_position: 1
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
This tutorial will guide you through the process of migrating your existing authentication system to Ory Identities, creating Ory
Network projects, setting up identity schemas, and customizing the user interface to match your current interface.
diff --git a/docs/oathkeeper/index.mdx b/docs/oathkeeper/index.mdx
index bca94f02a1..29c6798a1f 100644
--- a/docs/oathkeeper/index.mdx
+++ b/docs/oathkeeper/index.mdx
@@ -3,6 +3,12 @@ id: index
title: Introduction to Ory Oathkeeper Zero Trust Proxy
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
```mdx-code-block
import Help from '@site/docs/_common/need-selfhosted-support.mdx'
diff --git a/docs/oauth2-oidc/index.md b/docs/oauth2-oidc/index.mdx
similarity index 97%
rename from docs/oauth2-oidc/index.md
rename to docs/oauth2-oidc/index.mdx
index c49c432327..a8cb333e2c 100644
--- a/docs/oauth2-oidc/index.md
+++ b/docs/oauth2-oidc/index.mdx
@@ -4,6 +4,12 @@ title: Introduction to Ory Hydra OAuth2
sidebar_label: Introduction
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
OAuth2 is the industry-standard protocol that enables secure machine-to-machine communication and grants limited access to data
and services on behalf of users. OpenID Connect, built on top of OAuth2, is required to become a social sign-in provider.
diff --git a/docs/polis/admin-portal/index.mdx b/docs/polis/admin-portal/index.mdx
index 6d757e9989..33855adce4 100644
--- a/docs/polis/admin-portal/index.mdx
+++ b/docs/polis/admin-portal/index.mdx
@@ -3,6 +3,12 @@ id: index
title: Get started with Admin Portal
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
Ory Polis comes with an Admin Portal that allows you to manage **Enterprise SSO**, **Directory Sync** and **Setup Links** products
via an easy to use web interface.
diff --git a/docs/polis/directory-sync/index.mdx b/docs/polis/directory-sync/index.mdx
index 415bb4b0fc..78c1ad326b 100644
--- a/docs/polis/directory-sync/index.mdx
+++ b/docs/polis/directory-sync/index.mdx
@@ -3,6 +3,12 @@ id: index
title: Directory Sync
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
Directory sync helps organizations automate the provisioning and de-provisioning of their users. It is based on the System for
Cross-domain Identity Management (SCIM) protocol.
diff --git a/docs/polis/index.mdx b/docs/polis/index.mdx
index 07e72c86be..e4b48feaa0 100644
--- a/docs/polis/index.mdx
+++ b/docs/polis/index.mdx
@@ -4,6 +4,12 @@ title: Introduction to Ory Polis
sidebar_label: Introduction
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# Introduction to Ory Polis
Ory Polis - formerly known as BoxyHQ Jackson - is an Enterprise Single Sign-On (SSO) service for SAML and OIDC identity providers.
diff --git a/docs/polis/saml-federation/index.mdx b/docs/polis/saml-federation/index.mdx
index 97b99f8109..7ab05b4d80 100644
--- a/docs/polis/saml-federation/index.mdx
+++ b/docs/polis/saml-federation/index.mdx
@@ -3,6 +3,12 @@ title: SAML Federation
sidebar_label: SAML Federation
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
# SAML Federation
SAML Federation is an enterprise feature and you need to have an enterprise license to use this feature.
diff --git a/docs/polis/sso-flow/index.mdx b/docs/polis/sso-flow/index.mdx
index f042fdeeb7..0598dcd9ec 100644
--- a/docs/polis/sso-flow/index.mdx
+++ b/docs/polis/sso-flow/index.mdx
@@ -3,6 +3,12 @@ id: index
title: Single Sign-On
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
diff --git a/docs/polis/sso-providers/index.mdx b/docs/polis/sso-providers/index.mdx
index 31687cb73b..c0967977c1 100644
--- a/docs/polis/sso-providers/index.mdx
+++ b/docs/polis/sso-providers/index.mdx
@@ -4,6 +4,12 @@ title: SAML SSO Providers
sidebar_label: SSO Providers
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
Ory Polis supports the following SSO providers:
- [Generic SAML 2.0 Provider](./generic-saml.mdx)
diff --git a/docs/self-hosted/oel/index.mdx b/docs/self-hosted/oel/index.mdx
index 9f75bbc6cc..e11c52c2ac 100644
--- a/docs/self-hosted/oel/index.mdx
+++ b/docs/self-hosted/oel/index.mdx
@@ -4,6 +4,12 @@ title: Introduction to Ory Enterprise License
sidebar_label: Introduction
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
The Ory Enterprise License (OEL) is a commercial license designed for businesses and organizations that rely on Ory's open-source
identity and access control software (Ory Hydra, Ory Kratos, Ory Keto, Ory Oathkeeper, and Ory Polis) in production and
mission-critical environments. It grants access to enterprise-grade features, dedicated support, and builds optimized for
diff --git a/docs/self-hosted/oel/monitoring/monitoring.mdx b/docs/self-hosted/oel/monitoring/monitoring.mdx
index 844bc8bc0c..d2884d7ad5 100644
--- a/docs/self-hosted/oel/monitoring/monitoring.mdx
+++ b/docs/self-hosted/oel/monitoring/monitoring.mdx
@@ -3,6 +3,12 @@ id: monitoring
title: Monitoring
---
+```mdx-code-block
+import CanonicalUrl from "@site/src/components/CanonicalUrl"
+
+
+```
+
This guide presents exemplary monitoring configuration that will work with OEL applications.
## Prerequisites
diff --git a/docs/troubleshooting/index.mdx b/docs/troubleshooting/index.mdx
deleted file mode 100644
index ecc4e085df..0000000000
--- a/docs/troubleshooting/index.mdx
+++ /dev/null
@@ -1,12 +0,0 @@
----
-id: index
-hide_title: true
-title: Troubleshooting Index
-sidebar_label: Troubleshooting
----
-
-This is an index of the different troubleshooting guides.
-
-import DocCardList from "@theme/DocCardList"
-
-
diff --git a/src/components/CanonicalUrl/index.tsx b/src/components/CanonicalUrl/index.tsx
new file mode 100644
index 0000000000..d43ce54014
--- /dev/null
+++ b/src/components/CanonicalUrl/index.tsx
@@ -0,0 +1,17 @@
+import Head from "@docusaurus/Head"
+import useBaseUrl from "@docusaurus/useBaseUrl"
+
+interface CanonicalUrlProps {
+ path: string
+}
+
+export default function CanonicalUrl({ path }: CanonicalUrlProps) {
+ const absoluteUrl = useBaseUrl(path, { absolute: true })
+ const canonicalUrl = absoluteUrl.replace(/\/$/, "")
+
+ return (
+