Angualr5 sets routing url

package the angular code and upload it to the server. Refresh will report 404
Baidu, and add

to aap.model.ts.
   providers: [{ provide: LocationStrategy, useClass: HashLocationStrategy, }]

although it can solve the problem, it is added after url-sharp, generally does not have this. The home page shows a main domain name. Is there any other way to refresh without 404? For example, server configuration mapping and so on, the server I use is tomcat

Mar.10,2021

this is not a matter of server configuration mapping, it has nothing to do with the server. Yours is a single-page application, which involves routing. For more information, please see this article: https://codeshelper.com/a/11.


tomactweb.xmlangularhtml5

<error-page>
    <error-code>404</error-code>
    <location>/</location>
</error-page>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be5d54-31796.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be5d54-31796.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?