如何让Facebook爬虫使用ASP.NET MVC访问授权内容? [英] How do I allow Facebook crawler to access authorized content using ASP.NET MVC?

查看:101
本文介绍了如何让Facebook爬虫使用ASP.NET MVC访问授权内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在控制器中有一个Action方法如下:



Hi,
I have an Action method in a controller as below:

[Authorize]
public ActionResult ToDo()
{
  //Do some stuff
  return View();
}





我想通过其用户代理名称或IP范围允许facebook crawler访问ToDo的内容操作方法即使没有登录。这怎么可能?你的想法。



我尝试了什么:



没有尝试网络抓取和MVC时我很新。



I would like to allow facebook crawler either by its user agent name or IP range to access the content of ToDo Action method even without logging in. How is that possible? your thoughts.

What I have tried:

Haven't tried so far as I am very new with web crawling and MVC.

推荐答案

将搜索引擎蜘蛛(包括Facebook的)视为友好的访客用户。他们只能看到您允许访客用户查看的内容。



此Google搜索链接将指向可为您提供搜索引擎蜘蛛视点工具的页面... 作为搜索引擎蜘蛛查看页面 [ ^ ]





以下是一些额外的Asp.Net SEO技巧: ASP.Net网站的搜索引擎友好(SEO)技巧 [ ^ ]
Think of search engine spiders (including Facebook's) as a friendly guest user. They can only see what you allow a guest user to see.

This Google search link will point to pages that give you tools to have a search engine spider point-of-view... view page as a search engine spider[^]


Here are some additional Asp.Net SEO tips: Search Engine Friendly (SEO) Tips for ASP.Net Sites[^]


这篇关于如何让Facebook爬虫使用ASP.NET MVC访问授权内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆