Angular2 routing / deep linking not working with Apache 404

前端 未结 7 2014
自闭症患者
自闭症患者 2020-11-29 01:17

I am following the Angular 2 routing examples. Using the \"lite\" webserver I am able to navigate from the root and deep linking works, but using Apache I can navigate fro

7条回答
  •  佛祖请我去吃肉
    2020-11-29 01:58

    If you are working with the ionic build and upload your site on hosting server then you need to add the .htaccess file on your root directory inside the www folder.

        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} -s [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(.*) / [R=302,NC,L]
    
    
    

提交回复
热议问题