Given a simple page created in Servicenow with the following configuration:
Name: My Page Url Suffix: my-page Layout: foo
Inside foo, I load a one-page application with various routes, such as / invoice / 1, invoice / 2, user / 1, user / 2, etc.
I use react router for this routing, and although it supports hash routing freely, it clearly says that it is considered for "old browsers". And as of 2.4.1 it seems that having _key= is a requirement.
In any case, ideally, I donβt want to abuse the hashbangs to describe the route, instead I use a more typical URL structure.
Current:
instance.servicenow/my-page
Preferably:
instance.servicenow/my-page/invoice/1
This will require SNs to know that anything deeper than my-page should be redirected to my page. I came from the world of Apaches, and in this case I would simply write the following:
RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ - [L] RewriteRule ^ /index.html [L]
source share