我想从我的angularjs应用中移除#,我开发一个网站,我觉得这可能有助于使搜索引擎友好的网站,可能是我错了,请帮帮忙谢谢
I want to remove # from my angularjs app, I am developing an website, I think it may help to make SEO friendly website, May be i am wrong, Please help Thanks
我跟乔·劳埃德达成一致,去掉你的URL#的方式,但它不会帮助你,使你angularjs网站抓取。看看下面的步骤:
I agree with Joe Lloyd for the way to remove the # from your url but it won't help you to make your angularjs website crawlable. Check out the following steps :
配置html5mode
Configure the html5mode
配置(函数($ routeProvider,$ locationProvider){ $ locationProvider.html5Mode(真);
config(function ($routeProvider, $locationProvider) { $locationProvider.html5Mode(true);
添加< META NAME =片段CONTENT =&GT!;
到您的网页让谷歌机器人知道要添加_escaped_fragment_ =在哪里?您请求的结束。
Add <meta name="fragment" content="!">
to your pages so the google bot knows to add the ?_escaped_fragment_= at the end of your request.
办理的?_ escaped_fragment _ =
在服务器端,服务请求的HTML页面的静态快照(phantomjs可以使工作),使机器人的意愿指数呈现的版本的HTML页面。
Handle the ?_escaped_fragment_=
on the server side and serve a static snapshot of the requested html page (phantomjs can make the job) so the bot will index the rendered version of the html page.
填充您的sitemap.xml并把它运用到www.google.com/webmasters谷歌/
Populate your sitemap.xml and send it to google using www.google.com/webmasters/
玩得开心!