Skip to content
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

Shareable urls/deep links #672

Open
antonioaltamura opened this issue Aug 25, 2021 · 3 comments
Open

Shareable urls/deep links #672

antonioaltamura opened this issue Aug 25, 2021 · 3 comments

Comments

@antonioaltamura
Copy link

Hello, I'm trying to integrade vaadin router in a lit-element project. I realised if you refresh any page other than the home page, like /users/kim you are going to get a 404.
That is obviously because the webserver (whatever it is) looks for the physical file /users/kim. What is the preferred way to workaround this?
A redirect to index.html by default is not optimal, because you will get index.html even if you try to visit a wrong url like /fake_url_that_actually_should_return_404.

@ko1ebayev
Copy link

Hello! Facing the same issue, my router version is 1.7.4. Up!

@inqb
Copy link

inqb commented Feb 23, 2023

Assuming you're using Snowpack: you need to define SPA Fallback Paths

@djarekg
Copy link

djarekg commented Apr 27, 2023

I too have a similar issue. I have a lit project as well and I am getting a similar issue only on child routes.

/home WORKS
/customers WORKS
/customers/14 NOT WORK

When I refresh the page I do not get a 404 on the page, but styles listed using relative paths in the index.html get a 404 bc the base url i believe changes on a refresh when on a child route.

Instead of using http://localhost:8000 as the base url, when refreshing the page on a child route the base url becomes http://localhost:8000/customers, If I was on the child route /customers/14 for example.

This is what the url is on refresh for one of the stylesheets...

http://localhost:8000/employees/node_modules/@rask/web/src/css/baseline.css

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants