I do have an application build with ReactJS and React Router V4 that I'm trying to release to production.
At production I have Apache with the following configuration:
$ cat /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerName myapp.localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
SetEnv APP_HOME /usr/local/bin/myapp
<Directory "/var/www/html">
AllowOverride All
# Don't rewrite files or subdirectories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.html [L]
</Directory>
</VirtualHost>
On browse, I do:
http://192.168.0.100
it loads my landing page. But from there I cannot access any other url:
http://192.168.0.100/login
http://192.168.0.100/status
http://192.168.0.100/detail/1
http://192.168.0.100/dashboard
All pages I get the following error from Apache:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /status was not found on this server.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at 192.168.0.100 Port 80</address>
</body></html>
I'm pretty sure something is wrong with my configuration (may be my RewriteCond/RewriteRule), but no idea on how to solve it.