-
Notifications
You must be signed in to change notification settings - Fork 695
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
--single
serves index.html
even if files exist
#722
Comments
I think this intended behaviour, but it makes more sense to serve it only if the requested page does not exist. This would mean adding a I'd be willing to make a PR that addresses this if needed :] |
Correct me if I'm wrong here but entering the code below in {
"rewrites": [
{ "source": "/**", "destination": "/index.html" }
]
} In any case, I was about to post an issue regarding this when I found this issue. I've got a lab set up at https://gitlab.com/Backspaze/navigo-lab-2 which is published at https://navigo-lab-2.lovgren.io/. Download and run it locally with @gamemaker1 Do you have any further information regarding this issue? |
|
For those interested in an alternative while this issue is being worked on, I tried lwsjs/local-web-server which worked fine for my use case. It doesn't behave exactly like the web server in GitLab Pages but the difference is minor enough that it doesn't cause any real issues for me. |
The fix for this is to create the
Then when you start your static file server, you don't use the
The first item will send all requests that don't exist inside of |
Description
The description for
--single
is:Rewrite all not-found requests to index.html
.However, if
page.html
exists,/page.html
redirects to/page
which is then served withindex.html
.Here is a sandbox.
Library version
14.0.1
Node version
16.14.2
The text was updated successfully, but these errors were encountered: