Page reload fails when using Angular Ui Router with Html5 mode enabled

后端 未结 7 1364
醉酒成梦
醉酒成梦 2020-12-03 03:41

I am using Angular UI Router in my angular app and i have enabled HTML5 mode to remove the # form the URL by using $locationProvider in the config.



        
7条回答
  •  心在旅途
    2020-12-03 04:01

    first make .htaccess file then copy past these code

    
         RewriteEngine on
    
        # Don't rewrite files or directories
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^ - [L]
    
    
        RewriteRule ^ your root folder/index.html [L]
          
    
    
     in index.html file
    

提交回复
热议问题