2

自分の国 (cloudflare を使用) とユーザー エージェント (SEO ボット用) のみにアクセスを許可したい。したがって、実際には、私の国とユーザー エージェント (SEO 用) は allow/index.html にアクセスできますが、他のすべての人は other.html にリダイレクトされます。

私は .htaccess でこれを使用します:

RewriteCond %{HTTP:CF-IPCountry} ^(IT)$


RewriteCond $1 !^(allow)

RewriteRule ^(.*)$ /allow/index.html [L]

DirectoryIndex others.html


SetEnvIfNoCase User-Agent .*google.* search_robot
SetEnvIfNoCase User-Agent .*yahoo.* search_robot
SetEnvIfNoCase User-Agent .*bot.* search_robot
SetEnvIfNoCase User-Agent .*ask.* search_robot


Allow from env=search_robot

特にユーザーエージェントアクセスが正しいかどうかを知る必要があります。

4

0 に答える 0