Skip to content

Fixed Third Party Licenses 404 Issue on GitHub Pages #313

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sammy0318
Copy link

Closes #311
The Third Party Licenses page (/help/thirdPartyLicenses) was showing a 404 error when accessed directly through the GitHub Pages URL. This issue occurred because GitHub Pages doesn't natively support client-side routing used by React Router.

Solution:-
Modified the routing configuration to properly handle client-side routing on GitHub Pages:

Added a custom 404.html page with a script to redirect to the main application
Updated the index.html with a script to handle the redirect parameters
Changed from BrowserRouter to HashRouter for better GitHub Pages compatibility
Added homepage field to package.json

Changes

Created new 404.html in public folder
Added redirect script to index.html
Modified Routes.jsx to use HashRouter
Updated package.json with correct homepage URL

Testing

All routes now work with direct access
Navigation within the application works as expected
Third Party Licenses page loads correctly when accessed directly

@GMishx , @shaheemazmalmmd , @Kaushl2208
Sir please review my PR .

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 this pull request may close these issues.

404 Error on Missing Page in FOSSology UI
1 participant