【htaccess】ドメインをリダイレクト
サイトのドメインを変更した場合などに、旧ドメインでアクセスされたときに新ドメインへリダイレクトする方法です。
.htaccess
RewriteEngine On # 旧ドメイン RewriteCond %{http_host} ^makochin-web.net # 新ドメイン RewriteRule (.*) https://new-makochin-web.net/$1 [R=301,L]
上記の.htaccessをルートディレクトに設置します。
コメントを残す