Cannot load routing modules after building in Angular

后端 未结 1 787
清酒与你
清酒与你 2021-01-21 05:51

I am trying to build my angular app und serve it on xampp, but after building my Angular Project and copying the dist folder into the htdocs folder, I cannot access the routing

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-21 06:15

    Build your app like this using angular cli

    ng build --prod --base-href //
    

    Try with this one and let me know as It works for me

    
     RewriteEngine On
     RewriteBase /
     RewriteRule ^index\.html$ - [L]
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule . /index.html [L]
    
    

    0 讨论(0)
提交回复
热议问题