![見出し画像](https://assets.st-note.com/production/uploads/images/42634415/rectangle_large_type_2_69a1a97beecd63eb53edca017e267b1e.jpeg?width=1200)
Photo by
dailynote15
Apacheでリダイレクト設定をする
httpd.conf 等の設定ファイル
または .htaccessに以下を記述する
■サイトAに届いたアクセスを全てサイトBに転送する
RewriteEngine on
RewriteRule ^/(.*)$ https://www.BBBB.co.jp [R=301,L]
■HTTPアクセス全てをHTTPSへ転送する
RewriteEngine on
RewriteRule ^/(.*)$ https://www.AAAA.co.jp/$1 [R=301,L]
■HTTPアクセスの一部をHTTPSへ転送する
RewriteEngine on
RewriteCond %{REQUEST_URI} (/111/|/222/)
RewriteCond %{HTTPS} off
RewriteRule ^/(.*)$ https://www.AAAA.co.jp/$1 [R=301,L]
■一部のURLを別のURLへ転送する
RewriteEngine on
RewriteRule ^index.htm$ https://www.AAAA/index.html [L,R=301]
RewriteRule ^consultation.htm$ https://AAAA/index.html [L,R=301]
RewriteRule ^index1.htm$ https://AAAA/index.html [L,R=301]
RewriteRule ^kaisya.htm$ https://AAAA/company.html [L,R=301]