angularjs html5哈希url
我正在angular.js中使用服务器端google oauth 假设我的重定向url是localhost:8000/redirect。要删除我正在使用的angularjs中的#angularjs html5哈希url,angularjs,google-api,angularjs-routing,Angularjs,Google Api,Angularjs Routing,我正在angular.js中使用服务器端google oauth 假设我的重定向url是localhost:8000/redirect。要删除我正在使用的angularjs中的# $locationProvider.html5Mode(true); 但是,当我访问url时,我得到一个错误: Error response Error code 404. Message: File not found. Error code explanation: 404 = Nothing matche
$locationProvider.html5Mode(true);
但是,当我访问url时,我得到一个错误:
Error response
Error code 404.
Message: File not found.
Error code explanation: 404 = Nothing matches the given URI.
但是,如果我手动键入url,即localhost:8000/#redirect
,那么我会得到预期的结果,然后重定向到localhost:8000/redirect
我还尝试从谷歌应用程序控制台添加#。但是,这是不允许的
那么,如何完全删除散列呢 您在服务器端使用的是什么?在服务器端,您在任何情况下都应该返回布局html文件,在nodejs中是这样的:
app.get('*',function(req,res){res.sendfile('/views/layout.html');}
我使用的是angularjs分区,分区与“#”配合得很好