React Routing works on Heroku URL but not on custom domain URL

Viewed 82

I have a personal website jumpstarted with Create-React-App, repo'd through GitHub and deployed with Heroku. I bought a custom domain and have been trying to use routes with BrowserRouter like this:

      <BrowserRouter>
      <Routes>
            <Route exact path="/" element={<Blog />}></Route>
            <Route exact path="/questions" element={<Questions questionsMock={userSubmission} changeSubmission={setSubmission}></Questions>}></Route>
      </Routes>
      </BrowserRouter>

using the "/" path in my custom domain loads the correct landing screen. It's just the "/questions" route that has an issue.

With LocalHost and with the Heroku-generated URL we see the expected behavior: https://liv-personalsite.herokuapp.com/questions routes to the correct screen. However, in my purchased domain, the /questions throws an:

This site can’t be reached
The webpage at https://www.liv-victorino.com/questions might be temporarily down or it may have moved permanently to a new web address.
ERR_SSL_UNRECOGNIZED_NAME_ALERT

as per other similar issues, I've included a static.json file in the root directory containing

{
    "root": "build/",
    "clean_urls": false,
    "routes": {
      "/**": "index.html"
    }
  }

I can't tell if this is a Heroku issue or a NameCheap DNS issue (I bought the domain on namecheap). Why would it work on the Heroku link and not the custom link?

0 Answers
Related