Closed talwat closed 1 year ago
You can certainly do that in your app's "init" code!
For example, in the app.js
file (or whatever your "main" file is), you can import {location, replace} from 'svelte-spa-router'
then get the value of $location
, and if it's not #/
, then use replace()
to redirect the user.
Hi!
Is there any way to redirect or change the URL if the hash is not present?
For example, if they go to
mywebsite.com
it will redirect them tomywebsite.com/#/
?And if they go to
mywebsite.com/#
it will also redirect them tomywebsite.com/#/
.