我使用 URL 模式运行服务器http://*.self/
。基于客户端的用户代理字符串,无论他们的路径可能是什么,我都需要返回相同的内容。例如:
将通过以下方式返回完全相同的内容/path/to/search-bot/index.php
:
<body>
<h1>Thou sahll not!</h1>
</body>
这是我的 apache 虚拟主机:
<VirtualHost *:80>
ServerName self
ServerAlias *.self
VirtualDocumentRoot /some/path
</VitualHost>
以下...
BrowserMatch "(?i:Googlebot)" no_bot=1 #google
<If "reqenv('no_bot') == 1">
AliasMatch .* /path/to/search-bot/index.php
</If>
...运行后给我这个错误service apache2 restart
:
AliasMatch not allowed here
编辑
关于谷歌时钟的问题,是的,我理解,但我确实打算受到谷歌的惩罚。我有特殊的理由。