简体   繁体   English

使用语言代码禁止robots.txt中的子目录

[英]Disallow subdirectory in robots.txt with language code

We have a website translated to about 15 languages, with more comming in regulary from our editors. 我们有一个翻译成大约15种语言的网站,我们的编辑也会定期加入。

Our URL is built up as follows: 我们的URL构建如下:

SiteName.Company.com/{LCID}/Folder1/Folder2/ SiteName.Company.com/{LCID}/Folder1/Folder2/

Our company want's to hide a subfolder/page from the search engines. 我们公司希望隐藏搜索引擎中的子文件夹/页面。

LCID can be anything from EN-US to ZH-HANS. LCID可以是从EN-US到ZH-HANS的任何东西。 And i am looking for a solution where we don't have to update the robots file every time a new language is added. 我正在寻找一种解决方案,我们不必每次添加新语言时都更新机器人文件。

Can i make a wildcard entry or filter out a single foldername regardless of it's path? 我可以制作通配符条目或过滤掉单个foldername而不管它的路径是什么吗?

IE: companyinfo.nokia.com/en-us/aboutus/darknews/ I want Google to crawl everything but darknews and down (so /darknews/ELOPSellsOut or /darknews/3210revival) IE:companyinfo.no​​kia.com/en-us/aboutus/darknews/我希望谷歌抓住所有东西,但是黑暗新闻和下行(所以/ darknews / ELOPSellsOut或/ darknews / 3210revival)

Is this possible? 这可能吗?

You can do this with wildcards: 您可以使用通配符执行此操作:

User-agent: *
Disallow: /*/darknews/

Just be aware that not all robots support wildcards. 请注意,并非所有机器人都支持通配符。 This will work for Googlebot and Bingbot, but it will not work for many others. 这适用于Googlebot和Bingbot,但它不适用于其他许多人。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM