Use of /#/ in the middle of a URL
Asked Answered
H

1

8

I recently came across a web application whose URLs have the form:

https://URL.com/page/uuid/#/anotheruuid/area?action=whatever

I am confused as to the use of # in the URL. Usually, the pound symbol is reserved for fragment identifiers, which go at the end of a URL. What is the use here and what is its purpose?

Heading answered 29/12, 2017 at 21:1 Comment(0)
M
13

This is commonly used in SPAs (Single Page Applications). The purpose is to be able to navigate between different pages without reload the whole application. It is information to the client side framework / library to be able to route the app correctly.

For example one of the most common framework - Angular - supports two Location Strategies:

  1. HashLocationStrategy where URL looks like http://localhost/#/product
  2. PathLocationStrategy where URL looks like http://localhost/product

(source)

Minelayer answered 29/12, 2017 at 21:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.