在我们的网站中,此错误每 5 分钟出现一次。我不知道它从哪里调用。任何人都可以帮助我们吗?我们需要没有这个错误的 robots.txt。
我们的应用程序自动调用http://www.xyzName.com/content/images/thumbs/robots.txt 并显示以下异常
System.Web.Routing.UrlRoutingModule 没有实现 IHttpHandlerFactory 或 IHttpHandler。
说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
这是调用该方法时自动生成robots.txt文件的方法。但问题出在应用程序 robots.txt 自动调用的某些地方。
public ActionResult RobotsTextFile()
{
//Default Code blocked by Nilesh
if (_storeContext.CurrentStore.Url.Contains("tk"))
{
const string newLine = "\r\n"; //Environment.NewLine
var sb = new StringBuilder();
sb.Append("User-agent: *");
sb.Append(newLine);
sb.Append("Disallow: /");
Response.ContentType = "text/plain";
Response.Write(sb.ToString());
}
else
{
var disallowPaths = new List<string>
{
"/bin/",
"/content/files/",
"/content/files/exportimport/",
"/country/getstatesbycountryid",
"/install",
"/setproductreviewhelpfulness",
};
var localizableDisallowPaths = new List<string>
{
"/addproducttocart/catalog/",
"/addproducttocart/details/",
"/backinstocksubscriptions/manage",
"/boards/forumsubscriptions",
"/boards/forumwatch",
"/boards/postedit",
"/boards/postdelete",
"/boards/postcreate", …Run Code Online (Sandbox Code Playgroud)