-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Allow /404 file to act as wildcard route #121
Conversation
@scottnonnenberg Gatsby is using React Router 2.0 now which means the syntax for adding wildcard routes has changed somewhat. Would you mind creating a new PR against master? |
Updated! Includes my changes from #174. |
Rebased on latest master. |
Thanks! So one quick thought looking at this — I think this So I think the algorithm should be:
Thoughts? |
Good call. Closer to my original implementation. That should do it! Nice to be online at about the same time. :0) |
Indeed :) Thanks! Merging and I'll do a quick new release. If you have a bit more time, adding a follow-up PR to document this in the README.md would be 💯 |
Allow /404 file to act as wildcard route
Published 0.8.7 with this 💯 Will also add a sample 404 page to the three official starters. This is awesome thanks @scottnonnenberg! |
thanks @scottnonnenberg for 404 page routing. |
Can you give more details? e.g. Steps to reproduce?
|
One thing to keep in mind is that for the built version of the site, you need to set up your server to show the 404 file anytime it can't find a real file on disk. In nginx, that looks like this: error_page 404 /404/index.html; Note that this will NOT work if you're just using a simple pass-through file server like |
@KyleAMathews @scottnonnenberg |
For github pages, looks like our path might not match (their Simple solution for now: copy the file to the location github pages expects, and move your github pages to custom domain. |
@scottnonnenberg great research. @clouddra I switched the 404 url in starters to |
@scottnonnenberg @KyleAMathews Thanks for the help. Will try it out. |
@KyleAMathews should the same frontmatter appear in here, too? https://github.com/gatsbyjs/gatsby-starter-default/blob/master/pages/404.md |
@SachaG yes it should :-) I'll add that real quick. Thanks for bringing your fine-toothed bug-finder comb! |
Hiya @scottnonnenberg! 👋 This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here. Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! 💪💜 |
1 similar comment
Hiya @scottnonnenberg! 👋 This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here. Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! 💪💜 |
* new package * added tests * use new package
* new package * added tests * use new package
* new package * added tests * use new package
feat: add an seo component that can be used between pages/templates
Didn't see a way to put a 'not found' page in place, thought I'd add one.
Scenario: I've created a 404 page for nginx, but when it loads fully I get an empty screen because
react-router
doesn't know about the random URL the user attempted to load. This change allows me to put a404.jsx
somewhere in the project, and that is automatically registered as the wildcard handler.