I have built a simple react app using create-react-app and react-router-dom@6
And this happens only when i use BrowserRouter, HashRouter and MemoryRouter work just fine.
Please guide me how to build production app using BrowserRouter keeping in mind i will deploying it on linux server(hostinger.in) and in a subdirectory domain.com/react-app(!if .htaccess is required)
Few things i tried
- Adding "homepage" : "./" or "homepage" : "." in
package.json - Many .htaccess codes :')
You can see the hosted app Here
Top comments (1)
Try to add .env file in ur root dir and add PUBLIC_URL="URL"