Chapters8
Published8
Edition2026
Languageen-GB

The chapters.

In chronological order
Chapter 01
Why ship Next.js static to cPanel (and what you give up)
Deploy Next.js with no Vercel, no Node, on cPanel shared hosting. What static export forbids: no SSR, ISR, middleware, API routes, Server Actions.
9 min read·beginner
Published
Chapter 02
The next.config.ts for a static export cPanel serves
Set output:'export', trailingSlash:true, and images.unoptimized:true so next build writes an out folder your CI FTP job drops into public_html.
11 min read·intermediate
Published
Chapter 03
An MDX content pipeline that survives static export
Wire @next/mdx with remark-gfm, rehype highlighting, and rehype-slug under the App Router, then read MDX with gray-matter at build time. Deploy to cPanel.
12 min read·intermediate
Published
Chapter 04
Why next/image fails in static export — and the fix
next/image needs an optimisation server static export can't run. The fix is one config key: images.unoptimized, or a custom loader pointed at a CDN.
8 min read·intermediate
Published
Chapter 05
The .htaccess you need for cPanel/LiteSpeed
The .htaccess for a Next.js static export on cPanel/LiteSpeed, and why the SPA 'rewrite everything to index.html' breaks a trailingSlash site.
12 min read·intermediate
Published
Chapter 06
The 404.html trailing-slash bug and how to handle it
Under trailingSlash static export, Next builds 404/index.html, not 404.html, so cPanel serves its own 404. Point ErrorDocument at the real path.
8 min read·intermediate
Published
Chapter 07
A GitHub Actions FTP deploy that keeps your .htaccess
The SamKirkland FTP-Deploy-Action workflow for a static Next.js site on cPanel, and how to keep .htaccess from being dropped as a hidden file.
13 min read·intermediate
Published
Chapter 08
First deploy vs every deploy after: dangerous-clean-slate
Nextjs cpanel first deploy: flip dangerous-clean-slate true once to wipe stale files, then false so incremental deploys never nuke production.
10 min read·advanced
Published