-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow a base path to be set so app can run on a sub directory #279
Comments
I have the same problem, and I think the error is in the way the scripts are loaded in html. They have a / at the beginning which causes the relative location of the app in a subdirectory to be ignored. |
I'm facing the same problem too |
@Narutuffy As an interim measure, I've created a wrapper component for links and the router that takes a configured basepath and appends to routes passed in. Work's well but would prefer this to be part of the default components |
@jhdevuk any further info you can give on this fix? |
Looks like this is in progress in #100. Hopefully that can get merged quickly. |
It would be very convenient if the base path could be automatically picked from the <head>
<base href="/my-base-url/">
</head> Base URLs may be automatically rewritten from bundlers (e.g. snowpack), making it unnecessary to manually set it up, always staying aligned with other places. |
Maybe you'll fine this useful:
|
Hi,
I'm creating an app that will sit on many different sites, in partiular on sub directories like:
www.website.com/something/goes/here
In React Router you can set a
basename
property on the router so push state can work properly without directing the user back to the domain root, e.g:basename="/something/goes/here"
Is there a way I can achieve this in
preact-router
? I haven't found any reference to this in the docs.Thanks
The text was updated successfully, but these errors were encountered: