问题描述
如何在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中的搜索引擎中隐藏vew页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!