特定の IP アドレスを別のファイルにリダイレクトする .htaccess ファイルを作成しました。
# Allow rewriting of htaccess
RewriteEngine On
RewriteBase /
# Get remote address/block of addresses to redirect
RewriteCond %{REMOTE_ADDR} 127\.0\.0\.1
# Define the file being accessed
RewriteCond %{REQUEST_URI} /index\.php$
# When the remote address(es) try to access the file above redirect them to the file below
RewriteRule .* /other-index\.php [R,L]
これはうまく機能し、上の例では localhost が index.php にアクセスしようとすると、localhost を other-index.php にリダイレクトしますが、他のすべてのリモート ホストには index.php へのアクセスを許可します。
リモートホストが呼び出しています: http://www.example.com/index.php
私の質問は、リモート ホスト (この場合は localhost) が、サーバーによってリダイレクトされていることを検出できるかということです。