Official statement
Other statements from this video 14 ▾
- 2:06 Does duplicate content really hurt your SEO ranking?
- 2:39 Should you really use rel=canonical across different websites?
- 3:29 Should you really get rid of the meta keywords tag from your pages?
- 3:37 Does the duplicate content filter really penalize your pages or merely filter them out?
- 9:56 Do 301 redirects really cause a loss of PageRank during a site migration?
- 10:10 Do 301 redirects really dilute the PageRank that's passed on?
- 12:14 Is it true that internal link structure isn't a real issue for Google?
- 13:45 How does linking your new pages to the homepage really speed up indexing?
- 27:19 Can affiliate sites really rank without unique content?
- 30:08 Are Google’s algorithm updates truly continuous?
- 34:00 Does a slow site really kill your SEO, or is Google bluffing?
- 45:24 Do structured data really improve rankings or just enhance how results are displayed?
- 46:58 Does rel=canonical truly resolve trailing slash issues?
- 47:17 Is Google's approach to large-scale spam management focused on targeted action or just an algorithmic sweep?
Google confirms that URL fragments (anything after the #) cannot be redirected via a server-side 301. The server never receives this part of the URL. To manage these URLs, you need to use JavaScript for client-side redirection or deploy a rel=canonical to indicate the canonical version. This technical limitation directly impacts migration management and tracking parameters.
What you need to understand
Why don't 301 redirects work on fragments?
URL fragments (everything after the # character) are never sent to the server by the browser. This is a peculiarity of the HTTP protocol: when a user loads example.com/page#section, the server only sees example.com/page.
The fragment remains strictly on the client side. The browser interprets it to scroll the page or trigger JavaScript, but no HTTP request contains it. The result: it is impossible to set up a 301 or 302 redirect based on a fragment since your server never knows about it.
When does this limitation become a real issue?
This constraint affects several common scenarios. JavaScript applications often use fragments for routing (e.g., /app#/user/profile). Migrating these URLs to a clean structure without fragments requires client-side JavaScript management.
Tracking parameters embedded in fragments (#utm_source=newsletter) cannot be normalized through server redirects. You must handle these cases with JavaScript or accept a dispersion of analytics signals.
What does mentioning rel=canonical mean in this context?
Google specifies that rel=canonical can indicate which version of a page is preferred, even when variants with fragments exist. If you have /article and /article#comments indexed separately, the canonical unifies the signals.
Note: this does not redirect the user; it only consolidates SEO. The visitor remains on the URL with the fragment, but Google understands that the canonical version is the one without the fragment. It's a consolidation solution, not a browser redirect.
- Fragments are never sent to the HTTP server, making 301/302 redirects impossible
- JavaScript is the only option to redirect client-side based on the existing fragment
- Rel=canonical helps consolidate SEO signals between versions with and without fragments
- This limitation affects SPAs, tracking parameters, and fragmented social links
- No .htaccess or nginx configuration can intercept a fragment for redirection
SEO Expert opinion
Is this statement consistent with real-world observations?
Yes, this is a confirmation of what every web developer knows: fragments belong to the client-side DOM. Google is simply clarifying a protocol limitation. No surprise here, but many SEOs discover this point during a failed migration.
Where it gets tricky is when agencies set up server redirects based on fragments without understanding that it will never work. The server returns a 200 instead of a 301, creating duplicate content that is invisible until the next crawl.
What nuances should we consider with this rule?
Google mentions JavaScript as a solution, but it introduces a loading delay. If your script takes 300ms to execute, the user first sees incorrect content. For SEO, this is acceptable since Googlebot executes JS, but UX suffers.
The rel=canonical solves the SEO problem, not the user problem. [To be verified]: Google claims it correctly interprets canonicals pointing to fragment-free URLs, but several cases of partial consolidation have been reported on sites with complex SPA routing. Reliability depends on the consistency of your implementation.
In what situations does this limitation become critical?
SPAs migrations to hybrid or SSR architectures are particularly exposed. If you had /app#/product/123 and you're migrating to /product/123, you need to deploy a script that reads the fragment and redirects using JavaScript. No server fallback is possible.
Email campaigns with fragmented links (#summer-promo) lose all centralized redirection capability. If you change structure, each historical link remains frozen. The canonical helps Google, but the user clicking an old link arrives on a non-optimal page.
Practical impact and recommendations
What steps should you take to manage these URLs?
The first action: audit your indexed fragment URLs. Use site:yourdomain.com inurl:# to identify the affected pages. Many sites discover hundreds of URLs with fragments mistakenly indexed, diluting PageRank.
Next, deploy explicit canonicals on each page pointing to the version without the fragment. If /article#section exists, the canonical should point to /article. This consolidates signals even though user redirection remains impossible on the server side.
How can you implement a robust JavaScript redirect?
If you need to redirect based on a fragment, place a synchronous script at the top of the head to minimize unwanted content flash. Read window.location.hash, map it to the new URL, then use window.location.replace() to avoid polluting the browser history.
For instance: if #old-section exists, redirect to /new-page immediately. Test with a browser that has JS disabled: you need a fallback (canonical or meta refresh) to avoid trapping basic crawlers or users with JS disabled.
What mistakes should you avoid during a migration with fragments?
Classic mistake: trying to configure .htaccess or nginx rules to capture fragments. It will never work, the server does not see them. You're wasting time and creating a false sense of security.
Another trap: forgetting that UTM parameters in fragments (#utm_source=fb) do not carry over into Google Analytics if you use default tracking. You need to parse the fragment in JavaScript and send the data manually. Otherwise, your social campaigns disappear from reports.
- Audit indexed fragment URLs using site:yourdomain.com inurl:#
- Deploy rel=canonical on all pages with fragments pointing to the version without fragments
- Implement synchronous JavaScript redirects at the top of the page if necessary
- Test no-JS compatibility with a canonical or meta refresh fallback
- Configure analytics tracking to capture fragments and convert them into events
- Document the fragment patterns used to avoid regressions in development
❓ Frequently Asked Questions
Pourquoi mon serveur ne peut-il pas lire les fragments d'URL ?
Est-ce que Googlebot voit et indexe les fragments d'URL ?
Puis-je utiliser une balise meta refresh pour rediriger un fragment ?
Le canonical résout-il complètement les problèmes de fragments ?
Les fragments impactent-ils le crawl budget ?
🎥 From the same video 14
Other SEO insights extracted from this same Google Search Central video · duration 54 min · published on 28/06/2016
🎥 Watch the full video on YouTube →
💬 Comments (0)
Be the first to comment.