htaccess file not redirecting routes on my React App

by Chris   Last Updated August 14, 2019 04:00 AM

I am currenlty hosting my React App on an Amazon Lightsail LAMP instance. I have two versions of an htaccess file. One works for me when I host my React App on GoDaddy cPanel webhosting. I found the other online while trying to get the routing working.

This is the one that works on Godaddy:

RewriteEngine On 
RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]

This is the one I found online:

Options +FollowSymLinks -MultiViews
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.html [QSA,L]

I am starting to think it is somet9ing to do with the LAMP configuation on Lightsail. Any help on this would be much appreciated.

Related Questions

Updated November 20, 2018 18:00 PM

Updated January 28, 2019 06:00 AM

Updated July 11, 2019 01:00 AM

Updated June 25, 2017 16:00 PM

Updated November 19, 2018 21:00 PM