私の .htaccess ファイルには次のものがあります。
Options +FollowSymlinks
#+FollowSymLinks must be enabled for any rules to work, this is a security
#requirement of the rewrite engine. Normally it's enabled in the root and we
#shouldn't have to add it, but it doesn't hurt to do so.
RewriteEngine on
#Apache scans all incoming URL requests, checks for matches in our #.htaccess file
#and rewrites those matching URLs to whatever we specify.
#allow blank referrers.
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?site.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?site.dev [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?dev.site.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
site.com は本番サイトです。
site.dev は localhost 開発環境です。
dev.site.com は、ライブ テストを行うサブドメインです。
これにより、サイトのインデックス作成が回避されることは承知しています。
Header set X-Robots-Tag "noindex, nofollow"
参照。http://yoast.com/prevent-site-being-indexed/
ただし、私の質問はおそらくかなり単純です。
この行を dev.site.com にのみ適用して、インデックスが作成されないようにする方法はありますか?