简体   繁体   English

如何使用 robots.txt 禁止 Codeigniter 中的某些控制器

[英]How to use robots.txt to disallow to some controller in Codeigniter

I'm quite new to the topic robots.txt.我对 robots.txt 主题很陌生。 I had look about it for few hours and tried tom implement it.我已经研究了几个小时并尝试实现它。 I have controller named login and view.我有名为 login 和 view 的控制器。 All I want is Google search to list my view controller only not the login controller.我想要的只是谷歌搜索只列出我的视图控制器而不是登录控制器。 But now when I search for my site in Google, it is showing login before the view.但是现在当我在 Google 中搜索我的网站时,它在视图之前显示登录。 How can I remove login from listed in Goolge using robots.txt?如何使用 robots.txt 从 Goolge 中的列表中删除登录名?

A lot of information about robots.txt You can find there: http://www.robotstxt.org/robotstxt.html很多关于robots.txt的信息你可以在那里找到: http : //www.robotstxt.org/robotstxt.html

Simple example:简单的例子:

User-agent: *
Disallow: /test/

With this code, all user agents are disallowed to index "/test/" address.使用此代码,所有用户代理都不允许索引“/test/”地址。 Read about robots txt or show us Your code.阅读 robots txt 或向我们展示您的代码。

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

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