ドメイン名の一部を正規表現と一致させる必要があり、一致した部分がファイル名の一部である別のドメインにリダイレクトします。
this-is.com の htaccess の例:
this-is-a-test.com redirects to this-is.com/test.htm
this-is-a-fish.com redirects to this-is.com/fish.htm
this-is-a-duck.com redirect to this-is.com/duck.htm
これまでのところ、次のことを試しました。
RewriteEngine on
RewriteCond %{HTTP_HOST} ^this-is-a-(.*).com$
RewriteRule (.*) http://this-is.com/test.htm [L]
ただし、RewriteRule はクエリ文字列部分のみを処理し、ホスト部分は処理しないため、これは機能しません。
RewriteRule で RewriteCond の一致した部分を使用するにはどうすればよいですか?