谷歌云上的 Bitnami wordpress。
好的,下面的代码将所有内容转移到 https 非 www,效果很好,但问题是我们无法让专用 IP 重定向到 https url。请看下文;
RewriteEngine on
<ifModule mod_rewrite.c>
RewriteBase /
# IP REDIRECT CONANIZATION
RewriteCond %{HTTP_HOST} ^00\.00\.93\.114$
RewriteRule ^(.*)$ https://example.co.uk/$1 [L,R=301]
### WORKING HTTP to HTTPS / NON-WWW - WORKS
#if not example.co.uk then redirect to example.co.uk
RewriteCond %{HTTP_HOST} !^example\.co.uk$ [NC]
RewriteRule .* http://example.co.uk%{REQUEST_URI} [L,R=301]
#if not https
RewriteCond %{HTTPS} off
#redirect to https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>