When you encounter a 404 error not found in your Ionic PWA build for Angular or React, it means that the server is unable to locate the requested file or resource. To fix this, you need to include an .htaccess in your Ionic project and add the following directives.
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# Pass all requests not referring directly to files in the filesystem to
# index.html.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.html [L]
</IfModule>
Add new comment