如何在codeigniter中创建robots.txt文件以隐藏搜索引擎的查看页面

如何在codeigniter中创建robots.txt文件以隐藏搜索引擎的查看页面,codeigniter,robots.txt,Codeigniter,Robots.txt,如何在codeigniter项目中创建robots.txt文件以隐藏视图页面。我应该将robots.txt文件放在哪里 目前我已经创建了这样的文件 User-agent: * Disallow: /application/views/myviewpage.php 并排 /public\u html/folder/robots.txt(我将.htaccess文件放在这里)。有什么方法可以测试这个吗?robots.txt文件必须放在主机的文档根目录中。它在其他地方不起作用 如果您的主机是examp

如何在codeigniter项目中创建robots.txt文件以隐藏视图页面。我应该将robots.txt文件放在哪里 目前我已经创建了这样的文件

User-agent: *
Disallow: /application/views/myviewpage.php
并排
/public\u html/folder/robots.txt
(我将
.htaccess
文件放在这里)。有什么方法可以测试这个吗?

robots.txt文件必须放在主机的文档根目录中。它在其他地方不起作用

如果您的主机是
example.com
,则需要在
http://example.com/robots.txt


如果您的主机是
www.example.com
,则需要在
http://www.example.com/robots.txt

您不会阻止视图文件,因为爬虫程序无法直接访问该文件。您需要阻止用于访问视图的URL。@Jeemusu我是否应该在robots.txt文件中给出完整的URL,如下
http://www.server.com/folder/index.php/mycontroller/my_function
您不需要指定完整的url。只需
/index.php/mycontroller/my_函数