Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
URL リクエストに特定のパスがある場合、ドメインを変更する必要があります。具体的には、特定のパス (/path) が URL 要求に存在するかどうかを最初に特定する必要があります。存在する場合は、ドメイン www.mynewdomain.com/path/ の Web サイトを表示します。URL 要求に /path が存在しない場合は、www.myolddomain.com または要求が何であれ表示します。
RewriteRule を使用して、リクエストを新しいドメインにリダイレクトできます。仮想ホストで構成に言及できます。
RewriteEngine On RewriteRule /path(.*) http://www.mynewdomain.com/$1 [L,R]
/pathこの構成は、トークン [ で示される]の後の URL 部分を保持し、(.*)を使用してリダイレクトされたパスに書き換えられます$1。
/path
(.*)
$1