Cannot load routing modules after building in Angular

后端 未结 1 786
清酒与你
清酒与你 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 /<project_name>/
    

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

    <IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteBase /
     RewriteRule ^index\.html$ - [L]
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule . /index.html [L]
    </IfModule>
    
    0 讨论(0)
提交回复
热议问题