title: Get php server to serve index.html for all routes using react + react-router-dom
body: <p>Typically I make a website with reactjs + node + express, which is the usual combination. Then I deploy to Heroku and all is well.</p>
  
  <p>However, at request I have done reactjs front end with php back end deploying to cpanel and have run into the 404 issue with client side routing - if navigating directly to non-home-page route (let's say domain/quote) there is nothing on the server with that url and 404 error is thrown.</p>
  
  <p>I found the principle of the solution <a href="https://stackoverflow.com/questions/46056414/getting-404-for-links-with-create-react-app-deployed-to-github-pages">here</a> but this and all other answers I've found refer to node+express back ends only.</p>
  
  <p>Any way this can be done with a straight php back end? I am not using laravel or another framework. </p>
  
  <p>Also, though I have learned a lot recently I still consider myself a beginner - my apologies if the answer ends up being somewhat obvious.</p>