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

feat: add redirect to homepage for invalid URLs #381

Merged

Conversation

RachitSahu26
Copy link
Contributor

@RachitSahu26 RachitSahu26 commented Oct 28, 2024

What does this PR do?

This PR adds a redirect functionality to the homepage when users attempt to access invalid URLs. It enhances user experience by ensuring that users are guided back to the main page instead of seeing a 404 error page. This change addresses the issue of handling incorrect routes effectively.

Redirect Functionality: Added logic in the routing configuration of the App.jsx file to handle invalid URLs by redirecting them to the homepage.
Updated NotFound Page: Enhanced the NotFound component to inform users that they can navigate back to the homepage, providing a clear call-to-action with a button.

Fixes # #348

Uploading redirect.mp4…

How should this be tested?

  • Test 1
  • Test 2

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing guide
  • Self-reviewed my own code
  • Checked for warnings, there are none
  • Removed all console.logs
  • The changes don't cause any responsiveness issues

Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for delightful-daifuku-a9f6ea ready!

Name Link
🔨 Latest commit 01c06d6
🔍 Latest deploy log https://app.netlify.com/sites/delightful-daifuku-a9f6ea/deploys/671ff1af9094b700083a69ce
😎 Deploy Preview https://deploy-preview-381--delightful-daifuku-a9f6ea.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you @RachitSahu26 for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better.

@RachitSahu26
Copy link
Contributor Author

Hey @AlfiyaSiddique if i have made any mistake then tell me

redirect.mp4

@AlfiyaSiddique
Copy link
Owner

@RachitSahu26 make the 404 appear for some more time at least 2 seconds. It's too fast. The user should know that the page is 404 and then redirect

@RachitSahu26
Copy link
Contributor Author

@RachitSahu26 make the 404 appear for some more time at least 2 seconds. It's too fast. The user should know that the page is 404 and then redirect

okay i will do but could you please add level 3 label @AlfiyaSiddique

@AlfiyaSiddique
Copy link
Owner

@RachitSahu26 not a level3 PR. Give level2

@AlfiyaSiddique AlfiyaSiddique added gssoc-ext For GSSOC Extended Contribution. level 2 GSSOC level 2 Contribution - 25 points hacktoberfest-accepted labels Oct 28, 2024
@RachitSahu26
Copy link
Contributor Author

amzing.1.mp4

now i have increased redirect time @AlfiyaSiddique

@RachitSahu26
Copy link
Contributor Author

please merge it now

@AlfiyaSiddique AlfiyaSiddique merged commit 4ea8712 into AlfiyaSiddique:master Oct 29, 2024
5 checks passed
Repository owner deleted a comment from github-actions bot Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc-ext For GSSOC Extended Contribution. hacktoberfest-accepted level 2 GSSOC level 2 Contribution - 25 points
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants