简体   繁体   English

当 SSL 被强制时,如何排除某些文件夹被 ASP.net 中的搜索引擎索引?

[英]How can I exclude certain folders from being indexed by search engines in ASP.net when SSL is forced?

Good day,再会,

I've done some research looking for this answer, but haven't had much luck.我已经进行了一些研究以寻找这个答案,但运气不佳。 Hoping someone can help..希望有人能帮忙。。

The situation is that a site I'm working on (built in ASP.net) which forces SSL on most of their pages has some folders (ie. site.com/dontindex )containing files that definitely shouldn't be indexed by search engines.情况是我正在处理的一个站点(在 ASP.net 中构建)在他们的大多数页面上强制 SSL 有一些文件夹(即site.com/dontindex )包含绝对不应该被搜索引擎索引的文件. Google has links to these files in its index (ie. https://www.site.com/dontindex/file.pdf ). Google 在其索引中有指向这些文件的链接(即https://www.site.com/dontindex/file.pdf )。

My issue is that I have created a robots.txt file to disallow those folders from indexing, but from what I've read, that isn't going to prevent those files being indexed - as some of them might be referenced through secure pages.我的问题是我创建了一个 robots.txt 文件以禁止对这些文件夹进行索引,但从我所读到的内容来看,这不会阻止这些文件被索引 - 因为其中一些文件可能会通过安全页面被引用。 I'm thinking that only the non-secure pages are disallowed in this way.我在想只有非安全页面才会以这种方式被禁止。 Q1) Is that even correct? Q1)这是否正确?

When I tested http://www.site.com/dontindex/file.pdf against the new robots file in Google Webmaster Tools, wit came back as "Blocked by line 5: Disallow: /dontindex/", but when I tried https://www.site.com/dontindex/file.pdf it came back as "Not in domain". When I tested http://www.site.com/dontindex/file.pdf against the new robots file in Google Webmaster Tools, wit came back as "Blocked by line 5: Disallow: /dontindex/", but when I tried https://www.site.com/dontindex/file.pdf它以“不在域中”的形式返回。

From what I can gather, I should have a second robots.txt file somewhere for the secure files/folders.据我所知,我应该在某处为安全文件/文件夹创建第二个 robots.txt 文件。 I've read that if the site were running php, I could do some sort of a rewrite rule to cover this, but what to do in my ASP.net situation??我已经读到如果站点运行的是 php,我可以做一些重写规则来解决这个问题,但是在我的 ASP.net 情况下该怎么办? Q2) If it applies to me to have a second robots file (given that it's an ASP.net site), where should I put this file? Q2)如果它适用于我有第二个机器人文件(鉴于它是一个 ASP.net 站点),我应该把这个文件放在哪里?

Thank-you for any help!感谢您的任何帮助!

I think the problem is more to do with the Google webmaster tools, as http://site.com/robots.txt == https://site.com/robots.txt我认为问题更多与谷歌网站管理员工具有关,如http://site.com/robots.txt == https://site.com/robots.txt

The not in domain error is I think because Google classes the 2 as separate sites.我认为不在域中的错误是因为 Google 将 2 分类为单独的站点。 You need to add the https and http sites to check the robots file.您需要添加 https 和 http 站点来检查机器人文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从ASP.NET预编译中排除文件夹? - How do I exclude folders from ASP.NET precompilation? 如何为ASP.NET 4的某些文件夹禁用SSL? - How to disable ssl for certain folders of ASP.NET 4? 发布ASP.Net Web应用程序时,如何从删除中排除目标文件夹? - How can I exclude a target folder from deleting, when Publishing an ASP.Net web application? 当托管在 digitalocean 液滴上时,我无法让我的 asp.net mvc 使用 ssl - I can't get my asp.net mvc to use ssl when being hosted on a digitalocean droplet 如何防止托管在Azure上的开发登台网站被搜索引擎索引 - How to prevent a development staging website, hosted on Azure, from being indexed by search engines 如何在ASP.NET页中关闭SSL连接 - How can I close an SSL connection in an ASP.NET page 如何获取ASP.NET网站的预编译以排除某个文件夹 - How to get ASP.NET website precompilation to exclude a certain folder 如何从ASP.NET Web Api中的绑定中排除某些属性 - How to exclude certain properties from binding in ASP.NET Web Api 当数据库中发生某些更新时,如何在ASP.NET中收到通知? - How can I be notified in ASP.NET when a certain update happens in my database? 搜索引擎可以搜索数据库中的动态ASP.NET页面数据吗? - Is dynamic ASP.NET page data from database searchable by search engines?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM