-
Notifications
You must be signed in to change notification settings - Fork 113
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
Handle Github pages 404 issue #2179
Conversation
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
@astrojuanlu In slow motion you show that text "// in 404.html // in 404.html" was just for testing, I forgot to deploy the latest one , but now its updated. now it shows "Redirecting..." |
I fixed it now, if any sub path other than experiment-tracking is hit directly like this https://jitu5.github.io/experiment-trackingadsd, now it will be redirect to home/landing page. |
This approach is specifically added for Github pages, on hitting faulty URLs it redirect you to our custom 404.html but locally thing works same as before. |
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
# Conflicts: # RELEASE.md
Signed-off-by: Jitendra Gundaniya <[email protected]>
# Conflicts: # RELEASE.md
Signed-off-by: Jitendra Gundaniya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look's great now! thanks @jitu5 .. this was a tough one to fix, and u did it in a minimal way!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try using the exact same contents of the index.html
file for the 404.html
?
I just had to solve this issue for AlloyViz, which is also deployed to GH pages.
This is how I did it:
"build": "tsc && vite build && cp ./dist/index.html ./dist/404.html",
Might not be the same. Wanted to share my findings in case they were helpful!
@tynandebold Thanks for sharing your finding. This is even clear solution, I got once the control goes to client-router(React-router) it handle as normal button click or |
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing, all looking good for me 👍 thank you @jitu5
Description
Resolves #2048
This pull request includes changes to fix a 404 error on the experiment tracking page, and to ensure the 404 page is correctly redirect to root and manage by React router internally by keeping the content of the index.html and 404.html same.
Development notes
Redirect handling:
package.json
: Modified the build script to copyindex.html
to404.html
to ensure the 404 page is correctly served.QA notes
I have deployed the changes to Github pages https://jitu5.github.io to test.
Checklist
RELEASE.md
file