You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use SvelteKit in a subfolder on an Apache server, as in http://mysite/kit. Unfortunately, it seems like no matter what options I pick for the paths, something has a broken url.
On the Apache side, I have what should be a pretty straightforward reverse proxy:
Then I'm using Node v16.19.1 (it's an old server, I'm afraid) to run the "Sverdle" demo app on the server. I'm just trying to do the bare minimum to see if I can get SvelteKit working on this server. If I go to mysite:3000 everything appears as expected, as if I'm running the demo app locally.
Seeing as I'm running this demo app from a subdirectory, my first thought was to use relative: true in my paths configuration so that urls would be relative to the subdirectory. However, when I go to mysite/kit, I get a large number of 404s. The demo app is trying to access files from the root of the site instead of the subdirectory.
Oddly, this does sort of work with mysite/kit/ when the forward slash is added. Still, a number of 404s remain:
From what I can tell, there's some confusion in SvelteKit where some of it does recognize the subdirectory, but other parts are looking for files from the root.
My next thought was to use base: '/kit', which should allow the app to live in a subdirectory. Unfortunately, this rearranges the routing so now the app is at mysite/kit/kit, while the JavaScript files have urls under mysite/kit.
Is what I'm trying to do even possible? And if so, how can I control the paths so that the routing and urls match how I've set up the proxy?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use SvelteKit in a subfolder on an Apache server, as in http://mysite/kit. Unfortunately, it seems like no matter what options I pick for the paths, something has a broken url.
On the Apache side, I have what should be a pretty straightforward reverse proxy:
Then I'm using Node v16.19.1 (it's an old server, I'm afraid) to run the "Sverdle" demo app on the server. I'm just trying to do the bare minimum to see if I can get SvelteKit working on this server. If I go to mysite:3000 everything appears as expected, as if I'm running the demo app locally.
Seeing as I'm running this demo app from a subdirectory, my first thought was to use
relative: true
in my paths configuration so that urls would be relative to the subdirectory. However, when I go to mysite/kit, I get a large number of 404s. The demo app is trying to access files from the root of the site instead of the subdirectory.Oddly, this does sort of work with mysite/kit/ when the forward slash is added. Still, a number of 404s remain:
From what I can tell, there's some confusion in SvelteKit where some of it does recognize the subdirectory, but other parts are looking for files from the root.
My next thought was to use
base: '/kit'
, which should allow the app to live in a subdirectory. Unfortunately, this rearranges the routing so now the app is at mysite/kit/kit, while the JavaScript files have urls under mysite/kit.Is what I'm trying to do even possible? And if so, how can I control the paths so that the routing and urls match how I've set up the proxy?
Beta Was this translation helpful? Give feedback.
All reactions