For GoDaddy web hosting are two different solutions
IN Angular index.html write the base-href
<base href="/nameOfTheappFolder/"> or
Deploy ng build --prod --base-href "/nameOfTheAppFolder/"
IN you angular 6 app.module calls this provider
providers: [{ provide: APP_BASE_HREF, useValue: '/nameForTheAppFolder/'}]
for Linux hosting, you do the .htacces file like this where you replace the app directory folder name
<IfModule mod_rewrite.c>
Options Indexes FollowSymLinks
RewriteEngine On
RewriteBase /myappdirectory/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /myappdirectory/index.html [L]
</IfModule>
For Windows hosting you do web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="./index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>