-
Notifications
You must be signed in to change notification settings - Fork 42
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
Prefix and public subpath gives 404 #130
Comments
Hello @jobcespedes: Can you, please, post the contents of the routes file? |
Hi Jorge, Here it is
|
Hello, diff --git a/package.json b/package.json
index 2a26324..23934ea 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
- "start": "sirv public -s",
+ "start": "sirv public -s app/index.html",
"lint": "npm run format && eslint --ignore-path .gitignore .",
"format": "prettier --write --plugin-search-dir=. .",
"pretty": "npx pretty-quick --write \"{,!(node_modules|public)/**/}*.{js,svelte}\"" However, one issue remains (it could be some config or route missing on our part). Using http://localhost:5000 works. It is redirected http://localhost:5000/app/ automatically. However, using http://localhost:5000/app/ directly in the url bar, does not work. It gives http://localhost:5000/app/404 |
|
Please omit last message. A new pathname and redirect is not needed. My mistake. Running |
Still an issue when deploy to web server (npm run build). However, appending # to the end of the URL works. Ex https://example.com/app/# |
I am trying to serve a spa from subpath
app/
. However it is giving 404 errors when https://localhost:5000/app/The reason for it, its to serve another web site from root (https://example.com/) and this app in
app/
(https://example.com/app/), but from a different serverReproduce
From a base setup, the following steps were followed:
app
prefix to the app: Ex:<Router {routes} options={ {prefix: 'app'} } />
public/
content topublic/app
.public/app/index.html
to include '/app'. Example:src="/build/bundle.js"
tosrc="/app/build/bundle.js"
More details
Step 2
Before step 2,
public/
looked like:Now it looks like:
Step 3
index.html
content is now:Expected result
https://localhost:5000/app/ loads app index route
Actual result
https://localhost:5000/app/ redirects to https://localhost:5000/app/404
The text was updated successfully, but these errors were encountered: