The Problem
I opened Search Console for a client's Next.js site and found a chunk of URLs sitting under "Page with redirect" in the Page indexing report. The frustrating part: those were the exact canonical URLs I wanted indexed, the ones linked from the nav and listed in the sitemap. Organic traffic had been flat for weeks, and now I knew why. Google was not indexing them at all.
URL Inspection confirmed it. For /services, the verdict was "Page is not indexed: Page with redirect", and the crawl detail showed Google had been bounced to /services/ with a trailing slash. The page Google wanted to index redirected, so Google indexed nothing for that address. If your Next.js pages show up under "Page with redirect" instead of getting indexed, this is the usual cause.
Why It Happens
"Page with redirect" means Googlebot requested a URL and got a 3xx response, so it follows the redirect and considers the target for indexing instead of the URL it asked for. That status is harmless when it is an old URL pointing at a new one. It is a problem when the URL you are advertising as canonical is the one doing the redirecting.
On Next.js sites this comes from a handful of predictable places:
- Trailing slash mismatch. Your sitemap and internal links use
/services, butnext.confighastrailingSlash: true, so/servicesissues a 308 to/services/. Google crawls the slash-less version from your sitemap, hits the redirect, and files it under "Page with redirect." - www versus non-www, or http to https, handled at the edge or your host. Normal for old addresses, a problem if your sitemap lists the redirecting variant.
- A redirect in
proxy.tsorredirects()that unintentionally matches the canonical path. - A canonical tag that points at a URL which itself redirects, so even when Google lands on the right page, the canonical sends it back into a redirect.
The thread running through all of these: your sitemap, your canonical tags, and your internal links are pointing at the redirecting door instead of the final 200 page. Google keeps knocking on the wrong one.
The Fix
First, find the final URL for each affected page. A single curl tells you whether you are advertising a redirect:
curl -sI https://qasimcode.com/services | grep -i -E '^HTTP|^location'
# HTTP/2 308
# location: https://qasimcode.com/services/
A 308 (or 301/302) here means the address in your sitemap is not the indexable one. The fix is to make the sitemap, the canonical tag, and your internal links all point at the final 200 URL, and to commit to one trailing-slash policy.
Pick the policy in next.config and make every link match it:
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
trailingSlash: true, // choose one, then make every URL agree
}
export default nextConfig
Then emit the matching form in your sitemap. With trailingSlash: true, every URL needs the slash so Google never has to follow a redirect:
// app/sitemap.ts
import type { MetadataRoute } from 'next'
export default function sitemap(): MetadataRoute.Sitemap {
const base = 'https://qasimcode.com'
return ['/services/', '/blog/', '/about/'].map((path) => ({
url: `${base}${path}`, // trailing slash matches trailingSlash: true
lastModified: new Date(),
}))
}
Set a self-referencing canonical on the final URL so the page declares itself as the version to index:
// app/services/page.tsx
export const metadata = {
alternates: { canonical: 'https://qasimcode.com/services/' },
}
Finally, collapse any redirect chains to a single hop and use permanent redirects (308 or 301) rather than 302 for moves you intend to keep. Google's own Page indexing report documentation covers how each status is handled.
Verify before you ask Google to recrawl. Every URL in your sitemap should return 200 with no location header:
curl -sI https://qasimcode.com/services/ | grep -i '^HTTP'
# HTTP/2 200
Once the sitemap URLs all return 200, use URL Inspection on a sample page, request indexing, and hit Validate Fix on the "Page with redirect" issue so Google reprocesses the set.
One caveat: not every "Page with redirect" entry is a problem. Old URLs and http-to-https hops belong there. Only act when the redirecting URL is one you actually want in the index.
The Lesson
"Page with redirect" is Google telling you the address you advertised is not the address it can index. On Next.js sites it almost always traces back to a trailing-slash mismatch between your trailingSlash config and your sitemap or internal links. Align all three on the final 200 URL and the pages drop back into the index. Tweaking canonicals alone will not help if your sitemap still lists the redirecting version.
If Search Console is parking your money pages under "Page with redirect" and you need them indexed before the next reporting cycle, this is the kind of technical SEO cleanup I do for clients. See my services. For a related indexing issue, read Duplicate canonical in Search Console fix.
Need your Next.js pages back in Google's index? Get in touch.