私は次のようなドメインを持っています: this.that.com (そこからもアクセスできます:) that.com/this
私がやりたいことは、サーバーが上記の 2 つの URL からのすべてのリクエストを this.com に転送するようにすることです。
必要なので、this.that.com と入力すると、this.com に自動転送されます
前もって感謝します。
To redirect all requests to this.com
, match everything, which is not already this.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^this\.com$
RewriteRule .* http://this.com/$0 [R,L]
If you want to redirect to the main page instead, leave out the URL path
RewriteEngine On
RewriteCond %{HTTP_HOST} !^this\.com$
RewriteRule .* http://this.com/ [R,L]
If everything works as expected, you can switch to R=301
redirection.