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

False redirect to main page with trailing slash / #9

Closed
andrekovac opened this issue Dec 2, 2018 · 1 comment · Fixed by #11
Closed

False redirect to main page with trailing slash / #9

andrekovac opened this issue Dec 2, 2018 · 1 comment · Fixed by #11

Comments

@andrekovac
Copy link

andrekovac commented Dec 2, 2018

2 issues:

Given the below routes structure:

  1. If I go to https://mypage.com/imprint everything works find and it shows me the Imprint page.
    But if I want to go to https://mypage.com/imprint/ (extra slash at the end) it redirects me to home, i.e. / again, but not to /imprint where I would expect it to go to.

  2. If I got to https://mypage.com/something it correctly shows me the 404 page.
    But if I go to https://mypage.com/something/ (extra slash at the end) it redirect me to home, although something is not a valid route and it should show the 404 page again!

My routes look as follows:

{
    path: '/',
    render: () => import('./components/Home/index').then(mdl => mdl.default)
},
{
    path: '/imprint',
    render: () => Imprint
},
{
    path: '*',
    render: () => NotFound
}

I think it has to do with URL Normalization to deal with trailing slashes.

@quantizor
Copy link
Owner

I'll look into this soon! I've been on a work trip for the past week

quantizor added a commit that referenced this issue Feb 18, 2019
quantizor added a commit that referenced this issue Feb 18, 2019
* wip

* add example

having some trouble figuring out how to design the effect dependency
flow such that things aren't being triggered at unnecessary times

* yay it's working

* update README

* typo

* only use Suspense if the child to be rendered is React.lazy

Otherwise ReactDOMServer freaks out

* update tests & add one for useContext hook

* add react-is to rollup settings, remove unused babel transform

* unfocus test

* update readme

* ignore trailing slashes

fixes #9

* v2.0.0-alpha.0

* react-is -> ReactIs

* v2.0.0-alpha.1

* new sandboxes for v2
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

Successfully merging a pull request may close this issue.

2 participants