How to Capture Hallucinated URLs With 301 Redirects
To fix 404 errors from ChatGPT links, find the missing URLs that AI visitors hit, map each one to the closest real page by meaning, and add a 301 redirect for it. Where no close page exists, keep the 404 and make that page useful. Ahrefs says this is worth doing if the effort is low, not a major growth lever 1.
- An Ahrefs study found AI assistants send people to likely-404 pages 2.87 times as often as Google Search does 1.
- The rate is small: 0.43% across assistants against 0.15% for Google, so do not expect a big traffic win 1.
- Redirect only when a genuinely close page exists. A wrong redirect is worse than an honest 404.
- A missing page must still return a 404 status. A 200 with an error message is a soft 404 4.
Why do AI tools send people to pages that do not exist?
Because a model predicts what a plausible URL would look like, and sometimes it guesses wrong. Ahrefs published a study on 2 September 2025 covering about 16 million URLs. In one test of URLs people actually clicked, ChatGPT led to a likely 404 page 1.01% of the time. The average across six assistants was 0.43%, against 0.15% for Google, which is 2.87 times as often 1.
Handle these numbers with care. Ahrefs flagged a page as a likely 404 if its title contained '404' or 'not found', calls this 'not a perfect test', and drew on sites using Ahrefs Web Analytics 1. A second test of cited URLs gave different rates, 2.38% for ChatGPT and 0.84% for Google's top 20 results, because the base is different 1. Separate Vercel data shows what bots request: 34.82% of ChatGPT crawler fetches hit 404 pages, against 8.22% for Googlebot 2. That is crawler behaviour, not what users see.
Is it worth fixing on your site?
Usually it is a small job with a small payoff. The Ahrefs author says it is probably worthwhile when the fix takes very little effort, and is not a huge growth lever 1. A visitor who clicked an AI answer wanted something specific, so a correct redirect rescues a visitor who already wanted something specific, but the numbers are small.
Use a simple rule. If your AI-referred 404s are a handful a month, redirect the top few and move on. If they run into the hundreds, look for a pattern: the AI may be inventing a URL style that you could support with one rule.
| What you find | Action |
|---|---|
| A few 404s, each with an obvious matching page | Add exact 301 redirects. |
| Many 404s sharing a pattern, such as /resources/ instead of /guides/ | Add one pattern rule, then test. |
| A 404 for a page that never existed and has no close match | Keep the 404. Improve the 404 page. |
| A 404 for a page you deleted | Redirect to the replacement if one exists. If not, a 404 or 410 is fine. |
| Repeated requests for something you should offer | Consider creating that page. |
What do you need, and how long does it take?
You need access to either your analytics (GA4 or similar), your server logs, or both, plus the ability to add redirect rules. The first pass takes about two hours; that is our estimate. After that, a 20-minute check each month is enough.
The free AI 404 Redirect Builder matches broken URLs to your real pages and writes the rules.
How do you find the broken URLs?
Use two sources and combine them. In GA4, Google's default AI Assistant channel groups visits from sources such as ChatGPT, Gemini, DeepSeek, Copilot and Grok, and it excludes Google's AI Overviews and AI Mode, which count as Organic Search 8. Open a landing-page report for that channel and look for pages with titles like 'Page not found'.
Your server log is more complete. Filter for 404 responses where the referrer is an AI assistant, using the command in the templates. Treat counts as a floor, because some AI apps and browsers do not pass a referrer, and those visits can show up as direct traffic. Check your own logs to see how much this affects you. See how to track AI traffic in GA4 for the setup.
How do you choose the right destination for each URL?
Read the invented URL as a question. What did the visitor want? Send them to the page that answers that question best. If two real pages could fit, choose the one that gives the answer first. If none fits, do not force a redirect.
Never send every broken URL to the home page. That fits poorly with what the visitor asked, and it hides real gaps from you. This is our advice rather than a rule Google states.
- /pricing-plans -> /pricing: same intent, one obvious match, so 301.
- /blog/how-to-choose-payroll -> /guides/choose-a-payroll-provider: the page moved from blog to guides, so 301.
- /services/payroll-audit-cost -> no page exists: keep the 404 and list your service pages on the 404 page.
- /case-studies/acme -> check the archive: if a page ever existed, redirect to its replacement. If not, leave it.
Which kind of redirect should you use?
Use a permanent redirect. Google says permanent redirects tell it to show the new target in results, and it treats 301 and 308 as permanent 3. Temporary ones such as 302 keep the old URL in search results, which is not what you want here 3. Next.js sends a 308 when you set permanent to true, and it uses 307 for temporary redirects 5.
Point each rule straight at the final page, not at another redirect. Test with a command-line request after you deploy. The templates show nginx, Apache and Next.js versions. Nginx documents return 301 and rewrite with the permanent flag 6, and Apache's Redirect directive accepts the permanent keyword 7.
What should your 404 page do for the rest?
Ahrefs suggests a second option: improve your 404 page with a list of useful resources for disappointed AI visitors, rather than writing many redirects 1. Put your top pages, a search box and your contact link on it.
Make sure it really returns a 404 status. Google says a page that shows an error with a 200 status is flagged as a soft 404 in Search Console, and it treats 4xx errors, including 410, the same way 4. Redirecting a deleted page to a close replacement is also consistent with Bing's advice to retire redundant pages with a 301 redirect 9.
How do you check it worked, and keep watching?
Run the test loop in the templates against your mapping file. Every row should return a 301 or 308 to the expected page, with no second hop. Then check your analytics a month later: AI-referred sessions that previously landed on a not-found page should now reach the right page.
Repeat monthly for the first quarter, then quarterly. If the same invented patterns keep appearing, add a pattern rule or consider whether you should publish that page.
When is this not worth doing?
Skip it if you see no AI-referred 404s in your data, if the missing pages are junk with no real intent, or if you have no analytics or logs to measure with yet. In that case, start with how to check whether AI bots can crawl your site and read what hallucinated URLs are.
Frequently asked questions
Are hallucinated URLs a big problem?
They are real but small. Ahrefs found an average 0.43% likely-404 rate across AI assistants against 0.15% for Google in its click-based test 1. ChatGPT was highest at 1.01%. For most sites that means a handful of visitors a month, so fix the obvious ones and do not over-invest.
Should I redirect every broken AI link to my home page?
No. Redirect only to a page that answers what the visitor wanted. A blanket redirect sends people to something unrelated and hides the real gaps. If there is no close page, keep the 404 and make that page useful, as Ahrefs suggests 1. This is our advice, not a Google rule.
Is a 301 or a 302 better for this?
Use a permanent redirect. Google says permanent redirects tell it to show the new target in results, while temporary redirects keep the source page in results 3. A 301 or 308 fits a URL that should always lead to the new page.
Can I stop AI tools from inventing URLs?
We found no way to control it. The links come from the model, not from your site. What you can control is your own URL structure: clear, predictable paths are easier to guess correctly, and your 404 page and redirects limit the damage when a guess is wrong.
Sources
- New Study: How Often Do AI Assistants Hallucinate Links? (16 Million URLs Studied) · AhrefsOpened October 20, 2026. Supports: Published 2 September 2025. Test 1: average 0.43% likely-404 rate across six assistants vs 0.15% for Google (2.87x), ChatGPT 1.01%; Test 2: ChatGPT 2.38% vs 0.84% for Google top 20; method caveats; advice to 301 redirect or improve the 404 page; not a huge growth lever.
- The rise of the AI crawler · VercelOpened October 20, 2026. Supports: 34.82% of ChatGPT crawler fetches and 34.16% of Claude crawler fetches hit 404 pages, vs 8.22% for Googlebot; bot-side fetch data, December 2024.
- Redirects and Google Search · Google Search CentralOpened October 20, 2026. Supports: Permanent redirects show the new target in results; temporary redirects keep the source; 301 and 308 treated as permanent. Page last updated 2026-04-14.
- HTTP status codes, and network and DNS errors · Google Search CentralOpened October 20, 2026. Supports: 404 means content does not exist; 2xx error pages flagged as soft 404; 4xx errors except 429 treated alike. Page last updated 2026-02-04.
- redirects (next.config.js) · Next.js documentationOpened October 20, 2026. Supports: permanent: true uses status 308 and false uses 307; source, destination and permanent properties; read from the Next.js docs bundled with the installed version.
- Module ngx_http_rewrite_module · nginx.orgOpened October 20, 2026. Supports: return code URL syntax for 301; rewrite regex replacement with the permanent flag returns 301.
- Apache Module mod_alias · Apache HTTP Server ProjectOpened October 20, 2026. Supports: Redirect directive with the permanent status keyword returns 301; RedirectMatch uses regular expressions.
- Default channel group definitions · Google Analytics HelpOpened October 20, 2026. Supports: AI Assistant channel covers sources such as ChatGPT, Gemini, DeepSeek, Copilot and Grok and excludes Google's AI Overviews and AI Mode, which are Organic Search.
- Does Duplicate Content Hurt SEO and AI Search Visibility? · Microsoft Bing Webmaster BlogOpened October 20, 2026. Supports: Advice to consolidate or 301 redirect older or redundant pages. Post dated 19 December 2025.