0

I have a front end website done in react deployed with heroku. When you navigate to the main page it displays fine but when you try to navigate to a subpage like www.example.com/about it just displays a backslash. i can get to the subpages by clicking on my navigation buttons but typing in that exact url just takes me to the page with only a back slash appearing. I was thinking that I need to somehow use history from react-router-dom but don't know how any help is appreciated.

  • Have you searched for solutions? https://stackoverflow.com/search?q=heroku+url+rewrite What have you tried? – Sjeiti Apr 03 '19 at 15:09
  • I have tried to search but have come up with nothing similar to the problem I am encountering. I am using react-router-dom for routing and everything is fine locally. When the app is deployed on heroku i can not directly navigate to subpages. I am wondering if it could be a react-router-dom problem and i am missing some type of configuration. – Rylee Andrews Apr 03 '19 at 17:58
  • So creating a json file in the root doesn't work? (described here: https://stackoverflow.com/questions/48503348/configuring-a-single-page-create-react-app-on-heroku) – Sjeiti Apr 03 '19 at 18:43
  • I am using my own custom webpack configuration. Looks like that package generates one automatically? I guess my best route is to look into that package if my problem can be solved using it. – Rylee Andrews Apr 09 '19 at 15:03
  • Using that library solved my problem thanks – Rylee Andrews Apr 11 '19 at 19:07

0 Answers0