如何创建robots.txt文件以在Codeigniter中对搜索引擎隐藏视图页面 [英] How to create a robots.txt file to hide a view page from search engines in codeigniter

查看:55
本文介绍了如何创建robots.txt文件以在Codeigniter中对搜索引擎隐藏视图页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆