我能够从网址中删除#,但当网页重新加载时,它会转到404 我已将此添加到app.js:
if (window.history && window.history.pushState) {
$locationProvider.html5Mode(true);
}
和index.html
<base href="/lawyer/">
并创建.htacces文件并将其添加到其中
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI}
!^(/index\.php|/img|/js|/css|/robots\.txt|/favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]