---
title: pageExtensions
description: Extend the default page extensions used by Next.js when resolving pages in the Pages Router.
url: "https://nextjs.org/docs/14/app/api-reference/next-config-js/pageExtensions"
docs_index: /docs/14/llms.txt
version: 14.2.35
lastUpdated: 2023-09-02
prerequisites:
  - "API Reference: /docs/14/app/api-reference"
  - "next.config.js Options: /docs/14/app/api-reference/next-config-js"
---


> For an index of all Next.js documentation, see [/docs/14/llms.txt](/docs/14/llms.txt).
By default, Next.js accepts files with the following extensions: `.tsx`, `.ts`, `.jsx`, `.js`. This can be modified to allow other extensions like markdown (`.md`, `.mdx`).

```js filename="next.config.js"
const withMDX = require('@next/mdx')()

/** @type {import('next').NextConfig} */
const nextConfig = {
  pageExtensions: ['ts', 'tsx', 'mdx'],
  experimental: {
    mdxRs: true,
  },
}

module.exports = withMDX(nextConfig)
```
---

For an index of all available documentation, see [/docs/14/llms.txt](/docs/14/llms.txt)