In un post precedente abbiamo analizzato come sia necessario modificare il file web.config per poter gestire il refresh di pagine react senza ottenere l’errore 404 (not found). Una configurazione analoga deve essere effettuata anche in presenza di un server web apache. Di seguito la configurazione che dovrà essere utilizzata
<IfModule mod_rewrite.c>
RewriteEngine on
# -- REDIRECTION to https (optional):
# If you need this, uncomment the next two commands
# RewriteCond %{HTTPS} !on
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# --
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) index.html [NC,L]
</IfModule>