Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 通过htaccess可以绕过不允许的机器人?_Php_.htaccess_Robots.txt_Robot - Fatal编程技术网

Php 通过htaccess可以绕过不允许的机器人?

Php 通过htaccess可以绕过不允许的机器人?,php,.htaccess,robots.txt,robot,Php,.htaccess,Robots.txt,Robot,我有一个简单的问题。假设我在robots.txt: User-agent: * Disallow: / RewriteRule ^somepage/.*$ index.php?section=ubberpage&parameter=$0 在.htaccess: User-agent: * Disallow: / RewriteRule ^somepage/.*$ index.php?section=ubberpage&parameter=$0 当然,在index.php中

我有一个简单的问题。假设我在robots.txt:

User-agent: *
Disallow: /
RewriteRule ^somepage/.*$ index.php?section=ubberpage&parameter=$0
.htaccess:

User-agent: *
Disallow: /
RewriteRule ^somepage/.*$ index.php?section=ubberpage&parameter=$0
当然,在index.php中,类似于:

$imbaVar = $_GET['section']
// Some splits some whatever to get a specific page

include("pages/theImbaPage.html") // Or php or whatever

机器人能否看到脚本(
site.com/somepage
)中包含的html中有什么内容?我是说。。。URL指向无法访问的位置。。。(不允许使用
/somepage
),但仍将其重定向到有效位置(
index.php
)。

否。通过禁止机器人访问,机器人不允许浏览您网站上的任何页面,并且他们遵守您的规则,前提是机器人尊重
robots.txt
,这样它就根本看不到站点中的任何页面(您声明您使用了
Disallow://


但是,如果机器人不尊重您的
robots.txt
文件,那么它们将能够看到内容,因为重定向是在服务器端进行的。

带有问号“?”->的机器人应该能够看到脚本(site.com/somepage)包含的html中的内容?现在它看起来更像是一个问题。
robots.txt
是一种指导机器人不要遵循什么的方法。主要的机器人会遵守。但是,这并不意味着他们都会遵守,或者就此而言,他们将被禁止访问不允许的部分。如果你不允许你网站的某个部分或整个网站,他们将能够遵守看到了,但他们不会根据你的愿望和他们的选择。有什么办法来测试它吗?我猜他们尊重它,但我仍然需要2 b当然。P.S.是的……现在看起来更像是一个问题。@zozo:谷歌、雅虎和其他普通机器人尊重它