禁止 PHP 页面包含 robots.txt 中的所有 URL 参数

问题描述 投票:0回答:1

如何禁止我的

robots.txt
中的所有动态页面?

例如

  • page.php?hello=there
  • page.php?hello=everyone
  • page.php?thank=you

我希望

page.php
并且禁止所有可能的动态版本。

目前我有

User-Agent: *
Disallow: /page.php

但这仍然允许例如

page.php?hello=there

robots.txt
1个回答
1
投票

您已经拥有的内容应该阻止所有尊重 robots.txt 的搜索引擎对 /page.php 的所有访问(无论是否提供任何查询字符串参数)

不要忘记 robots.txt 仅适用于机器人 :-) 如果您尝试阻止用户访问该页面,您需要使用 .htaccess 或类似文件

© www.soinside.com 2019 - 2024. All rights reserved.