用 apache 的 rewrite 处理一下,比如
RewriteCond %{HTTPS} =off [NC] RewriteCond %{THE_REQUEST} /(login|register) [NC] RewriteRule ^(login|register) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]