Error 404 reloading a page of a PWA

Hi,
I’ve done a PWA with Ionic4.
It is installed behind an Apache server.
It seems to work, that is I can navigate through the pages of the site, but if I reload a page than a 404 error appears.
For example, if I navigate to the page

http://my.site.com/login

it works well, but if I reload the page with F5, for example, then I have the error:

Not Found
The requested URL /login was not found on this server.

What could be the error?
A misconfiguration of Apache?

Thank you very much

cld

I’ve solved fixing the Virtual Host definition on Apache in this way:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/plutoadmin
    ServerName  plutoadmin.xxx.net 
    <Directory /var/www/plutoadmin>
       	allow from all
	Options +Indexes
	Options Indexes FollowSymLinks

	RewriteEngine on
	# Don't rewrite files or directories
	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>

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

1 Like