What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 5 questions

Less than a minute. Find out how much you really know about Google search.

🕒 ~1 min 🎯 5 questions

Official statement

Fragment URLs cannot be redirected with a server-side 301, but they can be managed with JavaScript redirections or rel=canonical to indicate the preferred version.
40:13
🎥 Source video

Extracted from a Google Search Central video

⏱ 54:57 💬 EN 📅 28/06/2016 ✂ 15 statements
Watch on YouTube (40:13) →
Other statements from this video 14
  1. 2:06 Le contenu dupliqué nuit-il vraiment au référencement ?
  2. 2:39 Faut-il vraiment utiliser rel=canonical entre plusieurs sites différents ?
  3. 3:29 Faut-il vraiment supprimer la balise meta keywords de vos pages ?
  4. 3:37 Le filtre de contenu dupliqué pénalise-t-il vraiment vos pages ou se contente-t-il de filtrer ?
  5. 9:56 Les redirections 301 font-elles perdre du PageRank lors d'une migration de site ?
  6. 10:10 Les redirections 301 diluent-elles vraiment le PageRank transmis ?
  7. 12:14 La structure de liens internes est-elle vraiment un non-sujet pour Google ?
  8. 13:45 Pourquoi relier vos nouvelles pages à la homepage accélère-t-il vraiment l'indexation ?
  9. 27:19 Les sites affiliés peuvent-ils vraiment ranker sans contenu unique ?
  10. 30:08 Les mises à jour d'algorithmes Google sont-elles vraiment continues ?
  11. 34:00 Un site lent tue-t-il vraiment votre référencement ou Google bluffe-t-il ?
  12. 45:24 Les données structurées améliorent-elles vraiment le ranking ou juste l'affichage des résultats ?
  13. 46:58 Le rel=canonical suffit-il vraiment à résoudre les problèmes de trailing slash ?
  14. 47:17 Comment Google traite-t-il le spam à grande échelle : action ciblée ou coup de balai algorithmique ?
📅
Official statement from (9 years ago)
TL;DR

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.

Attention: Fragments are also not captured in server logs. It is impossible to diagnose which fragment is generating traffic without JavaScript analytics. Your visibility on these URLs is structurally limited.

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
Managing fragments in SEO requires coordination between developers, SEO, and analytics. The technical JS part, canonical logic, and tracking must be aligned. These optimizations, often underestimated in complexity, benefit from support from a specialized SEO agency capable of bridging technical skills and strategic vision to avoid common pitfalls during migrations or redesigns.

❓ Frequently Asked Questions

Pourquoi mon serveur ne peut-il pas lire les fragments d'URL ?
Les fragments (tout après le #) ne sont jamais envoyés dans la requête HTTP. Le navigateur les garde strictement côté client pour le défilement ou le JavaScript. Votre serveur reçoit uniquement la partie avant le #.
Est-ce que Googlebot voit et indexe les fragments d'URL ?
Oui, Googlebot exécute le JavaScript et peut interpréter les fragments pour afficher du contenu différent. Il peut donc indexer des URLs avec fragments si elles génèrent du contenu distinct, mais le canonical reste recommandé pour éviter la duplication.
Puis-je utiliser une balise meta refresh pour rediriger un fragment ?
Non, la meta refresh côté serveur ne voit pas le fragment. Seul JavaScript peut lire window.location.hash et déclencher une redirection basée sur le fragment. C'est la seule méthode fonctionnelle.
Le canonical résout-il complètement les problèmes de fragments ?
Il consolide les signaux SEO vers une version préférée, mais ne redirige pas l'utilisateur. Si un visiteur clique sur un lien avec fragment, il reste sur cette URL. Le canonical informe seulement Google de la version à privilégier dans les résultats.
Les fragments impactent-ils le crawl budget ?
Si Google indexe massivement des URLs avec fragments différents pointant vers le même contenu, ça dilue le crawl et disperse les signaux. Utiliser des canonicals réduit ce gaspillage en unifiant les variantes.
🏷 Related Topics
Crawl & Indexing AI & SEO JavaScript & Technical SEO Domain Name Redirects

🎥 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 →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.