tom_tom
tom_tom

Reputation: 465

URL parameter looking like directory

I have seen websites with site IDs in the URL looking like a folder.

For example: www.example.com/detail.html/42. The page is always the same and gets its content-ID from the URL without the typical GET parameters (.../detail.html?id=42). How can i manage this with Javascript?

Upvotes: 2

Views: 98

Answers (2)

Almis
Almis

Reputation: 3819

You can use javascript frameworks e.g. AngularJS or if you want only the routing you can use something like sammy.js or do it server-side

Upvotes: 2

garryp
garryp

Reputation: 5776

You can't. It's done server-side using URL rewriting.

https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

There are different ways of doing this depending on your technology stack (server-side).

If you're building a Single Page App these use something called hashbangs, but they aren't formatted like that.

Upvotes: 0

Related Questions