-1

In angular 7 when using <base href="/"> and ng build --prod on terminal , don't works on production server. If I use <base href="./"> Works but when refresh it loose the path and I get 404

Abhishek
  • 1,742
  • 2
  • 14
  • 25

1 Answers1

0

I found a solution here: Angular deployment - 404 on page Refresh

with -> import {LocationStrategy, HashLocationStrategy} from '@angular/common';

using >ng build --prod --base-href=/my/app/

It adds an # in the url but works fine and I can refresh the page.

Thanks