打开自己网站根目录, 例如 d:webroot, 在根目录新建一个名为 https.htm 的文件,内容如下:
<html> <head><title>Redirecting...</title></head> <script language="Javascript"> function redirectHttpToHttps() { var httpURL= window.location.hostname + window.location.pathname + window.location.search; var httpsURL= "https://" + httpURL; window.location = httpsURL; } redirectHttpToHttps(); </script> <body> </body> </html>标签:httpsURL,网站,httpURL,默认,window,location,https,根目录 From: https://www.cnblogs.com/zeenzhou/p/17177361.html