Resolving #angular / #ionicframework #routing Issue on shared servers using .htaccess

preview_player
Показать описание
Many of developers face routing issue in shared browser after deployment.

If user routes from root page then it works perfectly but whenever user tries to reload page then it shows 404 error.

Issue here is in angular routes handled though index file so we need to rewrite engine to resolve routing though angular index file.

RewriteEngine On
# If an existing asset or directory is requested go to it as it is
# RewriteCond %{REQUEST_URI} !^/(api|uploads/.*)$
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

Рекомендации по теме