kassim
November 9, 2022, 3:11am
1
Site Url: https://unique-mandazi-f9e328.netlify.app/
I have a react app that has some paths, When I try this https://unique-mandazi-f9e328.netlify.app/sales directly from the browser for example, it shows 404. but if i try the same within the app say via a button, it is able to navigate to the https://unique-mandazi-f9e328.netlify.app/sales .
What have I tried: I have tried checking the Published Deploy and I can confirm that there is an index.html file. I am not sure what next steps to take.
Thanks
clarnx
November 9, 2022, 9:57am
2
Hi @kassim , welcome. If possible can you share a repository of the site you are trying to deploy for me to help with the debugging.
Thanks.
kassim
November 9, 2022, 10:54am
3
Thanks for the reply, fijd the repo below. Since it’s private, u may need to be granted access to it.
https://github.com/qaasimahmad/TheGrandRealtyUI
clarnx
November 9, 2022, 1:08pm
4
Hi @kassim , since the repository is private I cannot view. You can create a minimal production repository of your site without any private information and then share.
Thanks.
kassim
November 10, 2022, 9:13am
5
Okay, I’ll work on this and share.
1 Like
kassim
November 10, 2022, 1:52pm
6
Hi there. I have a prod build. You can access it here
clarnx
November 10, 2022, 2:12pm
7
Hi @kassim , thanks for sharing.
May I know the button on the site you are referring to?
kassim
November 10, 2022, 2:17pm
8
CLick on the Arrow shown on the Homepage to move to the search page, then select either of the buttons shown in the screenshot.
Expected result BUY would change the url to https://unique-mandazi-f9e328.netlify.app/sales . while RENT will change the url to https://unique-mandazi-f9e328.netlify.app/rental
kassim
November 10, 2022, 2:19pm
9
Th issue is that if you go to the same directly without going via those buttons, the result is a 404 error.
There is also a path /verify-email, it also returns a 404 instead of redirecting to the HomePage. however on localhost, it works fine.
clarnx
November 10, 2022, 3:14pm
10
Hi @kassim , kindly create a _redirects
file inside the /public
folder like /public/_redirects
.
After paste the code below into the _redirects
file.
Your site should now work as expected when you explicitly visit the paths in the browser.
/* /index.html 200
Let me know the outcome.
Thanks.
kassim
November 10, 2022, 4:11pm
11
Alright, i’ll try it out shortly and revert
1 Like
kassim
November 10, 2022, 4:39pm
12
It worked like Charm👌. Thanks
1 Like
clarnx
November 10, 2022, 5:40pm
13
Hi @kassim , glad to know the suggestions helped to resolve your problem.
Thanks.