How I Fixed Ahrefs 308 Redirect + URL Out of Scope (www vs non-www on Cloudflare DNS + Vercel)
Bright Jasper
Author
I bought brightjasper.com on September 16 and ran an Ahrefs audit the next day.
The health score was 33%. There were 55 errors. Almost everything was a 308 redirect.
And Ahrefs kept reporting "3xx redirect in sitemap"
Why 308 and not 301?
Ahrefs shows 308 because that is what Vercel uses by default. Both 301 and 308 are permanent redirects, but 308 preserves the request method.
A 301 can change a POST request to GET. A 308 does not. If you have forms, API routes, or anything that sends POST requests, 308 is the safer choice. For SEO, both pass the same link equity. Vercel and Next.js use 308 for a reason, so there was no need to replace it with a 301.
The actual problem
I had four versions of the domain competing with each other:
http://brightjasper.comhttp://www.brightjasper.comhttps://www.brightjasper.comhttps://brightjasper.com
The sitemap used one version, the canonical used another, and Ahrefs was set to crawl a third. The result was a site that kept redirecting requests instead of giving every URL one clear, final home.
My setup
Cloudflare was set to DNS-only: the grey cloud, not the orange one. That meant Cloudflare was not proxying traffic.
Vercel handles HTTP-to-HTTPS redirects by default, so I did not need to add an HTTPS rule in Cloudflare.
That is also why I did not add a separate www redirect in Cloudflare. With DNS-only Cloudflare and Vercel handling the domain, adding another redirect layer would risk a loop:
Cloudflare -> Vercel -> Cloudflare
The fix
1. Pick one domain and commit to it
I chose https://brightjasper.com: HTTPS and non-www.
In Vercel, open Dashboard > Your Project > Settings > Domains.
Set brightjasper.com as the primary domain. Add www.brightjasper.com and set it to redirect to brightjasper.com.
Vercel handles the 308 automatically. You do not need a vercel.json file for this, but an explicit redirect would look like this:
{
"redirects": [
{
"source": "/(.*)",
"has": [{ "type": "host", "value": "www.brightjasper.com" }],
"destination": "https://brightjasper.com/$1",
"permanent": true
}
]
}
permanent: true produces a permanent redirect in Vercel. A 308 is fine here. Leave it alone.
2. Fix the canonical in Next.js
This was the part causing the most damage. Every page was canonicalizing to /.
In app/layout.tsx or lib/metadata.ts, set the site-wide base URL:
export const metadataBase = new URL("https://brightjasper.com");
Then give each page its own canonical path:
export const metadata = {
alternates: {
canonical: "/blog/fix-ahrefs-308-redirect",
},
};
For dynamic pages, build the canonical from the current slug. Check the generated HTML or page source and confirm that a post contains:
<link
rel="canonical"
href="https://brightjasper.com/blog/fix-ahrefs-308-redirect"
/>
It should not contain the homepage URL on every page.
3. Fix the sitemap
Your sitemap should use the same version of every URL: HTTPS, non-www, with no accidental homepage canonical.
In an App Router project, that can look like this:
export default function sitemap() {
return [
{
url: "https://brightjasper.com",
lastModified: new Date(),
},
{
url: "https://brightjasper.com/blog/fix-ahrefs-308-redirect",
lastModified: new Date(),
},
];
}
Make sure the sitemap, canonical URLs, and Ahrefs crawl target all use the same domain version.
4. Fix the Ahrefs audit scope
This is what caused the "URL out of scope" message.
In Ahrefs > Site Audit > Settings, set the project URL to:
https://brightjasper.com/
It should match the sitemap and canonical version exactly. Then rerun the audit.
Result
Before: 33% health and 55 crawl errors.
After: 100% health and 0 errors.
The re-crawl took about four minutes.
If you use Cloudflare proxy instead
If your Cloudflare DNS is orange-cloud proxied, Vercel's automatic HTTPS handling is not the whole setup. In that case:
- Go to Cloudflare > SSL/TLS and set the mode to Full, not Flexible.
- Create a Rules > Redirect Rule that sends
www.brightjasper.comtohttps://brightjasper.com. - Enable SSL > Edge Certificates > Always Use HTTPS.
But if your DNS is grey-cloud DNS-only, do not add those proxy rules. Let Vercel handle the redirect. Two systems trying to redirect the same request can create a loop.
Conclusion
The 308 redirects were not the real SEO problem. The real problem was that the sitemap, canonical URLs, domain settings, and Ahrefs crawl target were not all pointing to the same version of the site.
Choose one canonical domain, let one system handle redirects, and make every SEO signal agree with that choice. Once I used https://brightjasper.com consistently, Ahrefs could crawl the site properly, the health score reached 100%, and the "3xx redirects in sitemap" error disappeared.
Stack: Truehost (domain), Cloudflare DNS-only, Vercel, Next.js 14, and Ahrefs.