Skip to main content
短.be

URL Fragment

The portion of a URL after the "#" symbol. Used for direct links to specific page sections and for SPA routing.

Nov 28, 2025 · About 1 min read

URL Shortening

A URL fragment (also called a fragment identifier or hash) is the part of a URL after the "#" symbol. For example, in "https://example.com/page#section2," "#section2" is the fragment. The browser uses it to automatically scroll to the element with a matching id attribute.

A critical characteristic of fragments is that they are never sent to the server. When a browser accesses "https://example.com/page#section2," the request sent to the server is just "https://example.com/page" - the "#section2" part is processed entirely on the client side.

This behavior affects URL shortening services. If a shortened URL includes a fragment (e.g., https://miji.be/abc#section2), the shortening service's server cannot receive the fragment portion, so it may not carry over to the redirect destination. When shortening a URL that contains a fragment, verify beforehand whether the service preserves it correctly.

In SPAs (Single Page Applications), fragments are sometimes used for routing. URLs like "https://app.example.com/#/dashboard" and "https://app.example.com/#/settings" use hash routing to manage page state via fragments. However, path-based routing using the History API (/dashboard, /settings) is now the mainstream approach.

From an SEO perspective, Google ignores fragments when indexing pages. This means "/page" and "/page#section2" are treated as the same page. If you want a specific section to appear independently in search results, designing it as a separate URL (subpage) rather than a fragment is more effective. You can find related books on Amazon.

Share on XHatena

Was this article helpful?

Related Terms

Related Articles

FAQ

What is the difference between a fragment and a query parameter?
Query parameters (?key=value) are sent to the server and used in server-side processing. Fragments (#section) are not sent to the server and are processed only by the browser. This distinction affects how URL shortening services handle redirects.
Are fragments preserved in shortened URLs?
It depends on the service. Whether a fragment included in the original URL carries over after the redirect is implementation-specific. Test beforehand if fragment preservation is important for your use case.
Do fragments affect SEO?
Google ignores fragments, so there is no direct SEO impact. However, in-page links (like table-of-contents jumps) improve user experience, which can indirectly benefit SEO.

Ready to create a short URL?

Shorten a URL for Free