Setup guide

Add a blog at /blog on Next.js

Yes: three rewrites in next.config.js plus skipTrailingSlashRedirect: true. Without that flag, Next strips the trailing slash from /blog/hello-world/, the blog adds it back, and visitors hit a redirect loop. It works wherever Next.js runs as a server, Vercel included. A static export can't rewrite at all.

Where
next.config.js (.mjs and .ts take the same object)
Needs
a Next.js server: next start, Vercel, Netlify, a container. Not output: 'export'
Time
ten minutes and a deploy
Tested
Next.js 16.4.1, next build && next start, against our live edge, 2026-10-14

How it works

Set it up

  1. Set the address

    In AmplifySignal, open Settings → Blog address, enter https://acme.com/blog and save. Your blog keeps serving at our address until the check in step 4 passes.

  2. Add the rewrites

    next.config.js
    module.exports = {
      skipTrailingSlashRedirect: true,
      async rewrites() {
        return {
          beforeFiles: [
            { source: "/blog", destination: "https://sites.amplifysignal.com/b/acme.com/" },
            { source: "/blog/:path*/", destination: "https://sites.amplifysignal.com/b/acme.com/:path*/" },
            { source: "/blog/:path*", destination: "https://sites.amplifysignal.com/b/acme.com/:path*" },
          ],
        };
      },
    };

    Why it looks like this:

    • beforeFiles runs before Next checks its own pages and public files, so an old app/blog or pages/blog route can't shadow the proxy. Delete that folder anyway so nobody edits a page no one can see.
    • The slashed rule is the one articles use. Next's :path* doesn't carry a trailing slash into the destination, so /blog/:path*/ spells it out; Next's own docs use the same pattern.
    • The last rule catches the files with no slash: rss.xml, sitemap.xml, the article images.
    • skipTrailingSlashRedirect stops Next from 308-redirecting /blog/hello-world/ to the slashless URL before the rewrite ever runs.
  3. Deploy

    Rewrites are read at build time, so deploy the way you always do. Locally, restart next dev to pick them up.

  4. Check it

    Three requests from any terminal show whether the rule works before you press anything:

    terminal
    curl -sI https://acme.com/blog/ | head -1
    # HTTP/2 200
    
    curl -s https://acme.com/blog/_verify.json
    # {"edge":true,"host":"acme.com","service":"amplifysignal"}
    
    curl -sI https://acme.com/blog/<an-article>/ | head -1
    # HTTP/2 200

    A 301 on the article that points at the same URL, again and again, means something on the way is dropping the trailing slash. "edge":false means the rule points at amplifysignal.com instead of sites.amplifysignal.com.

    Then press Check in Settings → Blog address, or run as site blog-check acme.com. Check fetches /_verify.json through your address and passes when it answers for this site through our edge. From then on, links, canonical tags, the sitemap and the RSS feed use your address, and the old /b/ links redirect to it.

Mistakes we've seen or reproduced

Questions

Does skipTrailingSlashRedirect change the rest of my site?

Yes. Next stops normalizing slashes everywhere, so /about and /about/ both answer 200. If that bothers you, a proxy.js at the project root (called middleware.js, exporting middleware, before Next 16) puts the cleanup back everywhere except /blog:

proxy.js
import { NextResponse } from "next/server";

// skipTrailingSlashRedirect turns Next's slash cleanup off everywhere; put it back outside /blog.
export function proxy(request) {
  const url = new URL(request.url);
  if (url.pathname.length > 1 && url.pathname.endsWith("/") && !url.pathname.startsWith("/blog/")) {
    url.pathname = url.pathname.slice(0, -1);
    return NextResponse.redirect(url, 308);
  }
}

We ran it on 16.4.1: /about/ redirects to /about, blog URLs keep their slash.

I'm on Vercel. Do I need vercel.json too?

No. Vercel runs the rewrites in next.config.js; use this guide, not the Vercel one. Keeping the rules in Next's config also means next start anywhere else behaves the same.

Does this work with the Pages Router?

Yes. rewrites() is the same in both routers, and beforeFiles overrides a pages/blog route just as it does app/blog.

My config is next.config.ts or .mjs.

Same object, exported with export default instead of module.exports. In TypeScript, type it as NextConfig from next.

Why sites.amplifysignal.com and not amplifysignal.com?

sites.amplifysignal.com is our edge: a request there tells us it came through your proxy, so we serve the page as yours. Once your address is verified, amplifysignal.com redirects a blog's visitors to your address instead, so a proxy aimed there would send people in a circle. Check names the problem if a rule points at the wrong one.

Do these rules work for a blog that isn't on AmplifySignal?

The mechanics carry over: swap the destination for any server that hosts your blog under a path. Copy two things along with them. Keep the trailing slash if that server's URLs end in one, and make sure its links and canonical tags name your address, or search engines index the other host instead. Ours switch the moment Check passes.

Can I use blog.example.com instead?

Yes, on any platform: one CNAME from blog to sites.amplifysignal.com, and we issue the certificate. A folder shares your main domain's authority, which is why these guides lead with it; the subdomain steps are on the overview.

What this is based on

Checked against the platform's documentation on 2026-10-14; where the facts above say tested, we ran the snippet ourselves against the servers that host our own blog and followed every URL to a 200.

Other platforms

No blog to put there yet?

AmplifySignal hosts it, drafts the articles from your keywords and Search Console data, publishes them on a schedule and sends the social posts. Every account starts with a free week, or begin with a free 90-day launch plan.

Start free