问题描述
如何在codeigniter项目中创建robots.txt文件以隐藏视图页面。我应该在哪里放置此robots.txt文件
,目前我已经创建了这样的文件
How to create a robots.txt file in a codeigniter project to hide a view page . where should i place this robots.txt filecurrently i have created file like this
User-agent: *
Disallow: /application/views/myviewpage.php
在
/public_html/folder/robots.txt
(我将我的 .htaccess
文件放在哪里)。有什么方法可以测试吗?
in side/public_html/folder/robots.txt
(Where i place my .htaccess
file). Is there any way to test this?
推荐答案
robots.txt文件必须放置在主机的文档根目录。
The robots.txt file MUST be placed in the document root of the host. It won’t work in other locations.
如果您的主机是 example.com
,则需要可访问它在 http://example.com/robots.txt
。
If your host is example.com
, it needs to be accessible at http://example.com/robots.txt
.
如果您的主机是 www.example.com
,则需要在 http://www.example.com/robots.txt
进行访问。
If your host is www.example.com
, it needs to be accessible at http://www.example.com/robots.txt
.
这篇关于如何创建robots.txt文件以在Codeigniter中对搜索引擎隐藏视图页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!