[Vuejs]-Ionic Vue PWA – 404 error when reloading the page

0👍

For Apache , the solution is to create an .htaccess file in the root of your site:

  1. Enable .httaccess files. In the end of /etc/apache2/sites-available/000-default.conf (name of the file might differ), add the following code:
 ServerName localhost 
 ServerAdmin dimdimopoulos@outlook.com 
 DocumentRoot /**projects_folder_name**/
 <Directory /**projects_folder_name**/>
    Options Indexes FollowSymLinks
    AllowOverride All
 </Directory>
 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined
  1. Create the .htaccess in the root of your site, with the following code :
 Options +SymLinksIfOwnerMatch
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /**your_site_root_folder**/ [L]

I hope this helps.

Best regards

Leave a comment