Javascript angular.js中用户友好的SEO
我可以从url中删除#,但当页面重新加载时,它会转到404 我已将此添加到app.js:Javascript angular.js中用户友好的SEO,javascript,html,angularjs,.htaccess,Javascript,Html,Angularjs,.htaccess,我可以从url中删除#,但当页面重新加载时,它会转到404 我已将此添加到app.js: if (window.history && window.history.pushState) { $locationProvider.html5Mode(true); } 这是index.html <base href="/lawyer/"> 那么,你的问题是什么?仍然无法使URL变得用户友好?当我刷新页面时,它仍然会转到404。你的URL现在怎么样了?你希望他们怎
if (window.history && window.history.pushState) {
$locationProvider.html5Mode(true);
}
这是index.html
<base href="/lawyer/">
那么,你的问题是什么?仍然无法使URL变得用户友好?当我刷新页面时,它仍然会转到404。你的URL现在怎么样了?你希望他们怎么样?这将非常有助于找到一个解决方案……现在它们是:localhost/myproject/#/home,我希望它们是localhost/myproject/home。您阅读、理解并实现了吗?
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]