I have been trying to deploy my Angular 7 application to HTTPD Apache 2 Server. These are the steps I have taken:
- Setup a Virtual Host for my project
- Build --> ng build --prod
Created and configured .htaccess as instructed here:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L]
Configured my app-routing.module.ts like this:
imports: [RouterModule.forRoot(routes ,{onSameUrlNavigation: 'reload'})]
My main page works but when I try to navigate through other routes e.g. http://myhostname/users/crud, it won't work anymore. Is there something I have missed here?
Thanks.