preact-boilerplate
preact-boilerplate copied to clipboard
404 \ Page not found when deploying to Netlify
I'm not sure if other static site servers / platforms are all like that, but if we deploy this to Netlify we can only navigate from index.html to other pages using Links, once your refresh or type a URL directly in the address bar we'll get 404
In order to get History push state to work we need to add this re-write rule:
/* /index.html 200
which can be in a file for Netlify in the repo root.
Can we add this directly? as I can see Netlify support is welcome in the Preact repo.
Sure! Any chance there's a way to define that in the .toml file? If not then a separate does file is fine.
Unfortunately no. Netlify does in in 1 way only, which is having a _redirects file in the deployed folder eg dist/
but I'll have to update the docs accordingly
Ref: (https://www.netlify.com/docs/redirects/)[https://www.netlify.com/docs/redirects/]
Looking more into this...
I think we decided to punt on this for now, right?
I think it's very good to have and won't harm if people won't need it! if ytou think so too, here's a PR https://github.com/developit/preact-boilerplate/pull/103
I think people need this. I had to go through a lot of pain to get to understand how to use this. It is really helpful especially for situations where you decide to use routers from you js application
Can anyone help me with this problem "PAGE NOT FOUND. Looks like you've followed a broken link or entered a URL that doesn't exist on this site." I really don't know what to do. My folder came from hithub and when I'm finish deploying it in netlify, when I view my site, It goes like this.
You need to configure the fallback HTML page. You can do this by simply copying dist/index.html
to dist/200.html
and redeploying.
actually i have the same problem, anybody can say exactly what i should do. Thanks
in my case, for create-react-app:
- create a
_redirects
file in public - add
/* /index.html 200
to that file
but how I had the same problem and it solved but could you please explain what is the reason behind it?
i have the same problem please help
i have the same problem please help
same :/
I think, my situation is there isn't the index.html page. so that why the server doesn't know which page to take. So to solve the problem, try to put an index.html page.
Le mer. 22 janv. 2020 à 23:17, Harold ARABA [email protected] a écrit :
i have the same problem please help
same :/
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/developit/preact-boilerplate/issues/101?email_source=notifications&email_token=AKBZXYY7SQJFVGATJRROC33Q7DAYLA5CNFSM4C3VKEGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJVJZOA#issuecomment-577412280, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBZXYYZFPHNK2EFOWOS7ATQ7DAYLANCNFSM4C3VKEGA .
in my case, for create-react-app:
- create a
_redirects
file in public- add
/* /index.html 200
to that file
thanks man! it worked for me