solid router, absolute routes?
So i have compiled my solid app and have a few things i would like to change but dont know how, right now i host the app on my school server so for example server.com/name.surname/project_name/index.html
so as u can see the app should run inside the project name folder but when i use the routing in the app, the search bar domain says for example server.com/contact and not server.com/name.surname/project_name/contact like it should which also makes the links not work when manually browsing to them, any fix?
<Router root={Bars}>
<Route path="/" component={Home} />
<Route path="/productie" component={Productie} />
<Route path="/over_ons" component={Over} />
<Route path="/historiek" component={Historiek} />
<Route path="/contact" component={Contact} />
<Route path="*" component={Verkeerde}/>
</Router>
that is my code for the routing
2 Replies
you are looking for the
base
option in vite config
you can do base: './'
i think- Router has a
base
prop
- Vite supports a base config option accessible with import.meta.env.BASE_URL
- You'll probably want to vary that config based on dev vs. prod.