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

Not Found when directly accessing a link #96

Open
scifisatan opened this issue Oct 23, 2024 · 5 comments
Open

Not Found when directly accessing a link #96

scifisatan opened this issue Oct 23, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@scifisatan
Copy link

Describe the bug
When accessing a URL with a path directly in the browser, such as https://nepali-calendar-p3ysqzfcv-posk.vercel.app/calendar/2081/7, the page returns a "Not Found" error. This issue occurs because the project is a Single Page Application (SPA), and the server is not configured to handle direct path requests.

To Reproduce
Steps to reproduce the behavior:

  1. Copy and paste the link with a path (e.g. https://nepali-calendar-p3ysqzfcv-posk.vercel.app/calendar/2081/7) into the browser's address bar.
  2. Press Enter.
  3. You will see a "Not Found" error instead of the expected page content.

Expected behavior
When navigating directly to a URL with a path, the page should display correctly as it would if navigating within the application itself. The server should serve the index.html file, allowing the client-side routing to handle the path.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Edge

Additional context
This issue is typical with SPA projects when server-side routing is not correctly configured to redirect all requests to index.html. A potential fix would involve setting up redirects on the server or updating the deployment configuration (e.g., Vercel, Netlify) to handle SPA routing properly.

@scifisatan scifisatan added the bug Something isn't working label Oct 23, 2024
@scifisatan
Copy link
Author

how can i contribute? Since, it's hosted on vercel, it's a simple fix for now

@scifisatan
Copy link
Author

it's working on the main domain, only not seeming to work on preview builds.

@nirajacharyaa
Copy link
Member

https://miti.bikram.io is hosted on Cloudflare, not on Vercel that's why.

@Parajulibkrm
Copy link
Member

it's working on the main domain, only not seeming to work on preview builds.

We were previously using vercel to deploy previews from Frontend, we are slowly moving to cloudflare, and vercel will no longer be used from v2

@scifisatan
Copy link
Author

Cloudflare is such a good choice. I've been using it recently as well. Kudos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants