PDA

View Full Version : HashState and URL Paramenters



Tom Murphy
23-Oct-2018, 04:55 AM
This is more an observation (that leads into my next post)

Out of the box a URL now looks like...

http://localhost/WebOrder_19_1/Index.html#Order


Now I want to add in URL parameters, however the following doesn't work...

http://localhost/WebOrder_19_1/Index.html#Order?terms=NET60

You need to do...

http://localhost/WebOrder_19_1/Index.html?terms=NET60#Order

starzen
23-Oct-2018, 06:51 AM
yes, thats a bad choice for URLs. Not sure if it has changed but it also limits analytics software. Google actually created a workaround called hashbang

better

http://localhost/WebOrder

or to go to a view

http://localhost/WebOrder/Order

or to also find an order

http://localhost/WebOrder/Order/20812

Harm Wibier
23-Oct-2018, 11:36 PM
Obviously the reason for using the hash is because it requires no additional server configuration. If you worry about SEO or how your URL's look than you can go the extra mile of configuring a URL rewrite (which is supported by the framework, tutorials on that are coming). It is not uncommon for JavaScript frameworks to use the URL hash like this, browsers actually have special JavaScript API's and events for it.

Tom Murphy
24-Oct-2018, 12:11 AM
That's fine we're looking at URL rewrite. It was more interesting where the URL parameters have to be placed when using the #.