How to rewrite url in apache htaccess for angularjs app

前端 未结 2 1979
遇见更好的自我
遇见更好的自我 2021-01-22 13:05

The htaccess I\'m using is as follow

RewriteBase /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %         


        
2条回答
  •  忘掉有多难
    2021-01-22 13:50

    I handle this issue in my project with working on my VirtualHost

    
        DocumentRoot "/Applications/MAMP/htdocs/angular"
        ServerName  zeyton.dev
        ServerAlias www.zeyton.dev
        DirectoryIndex index.html
      
        order allow,deny
        allow from all
        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} -s [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(.*) /index.html [NC,L]
      
    
    

提交回复
热议问题