301 導向,簡單方式
Redirect 301 / https://www.domain.tld/
把 .com 導到 .net 去,301 方式 複雜一點
RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com [NC,OR] RewriteCond %{HTTP_HOST} ^www.example.com [NC] RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]
http 導到 https
RewriteEngine on RewriteCond %{HTTPS} !=on # 或換成 off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
留言