将单页http重定向到https

Liz*_*der 13 .htaccess https redirect http http-redirect

我正在尝试使用.htaccess将单个页面从http重定向到https,但我不断收到重定向循环错误.

码:

Redirect /secureform.html https://www.example.com/secureform.html
Run Code Online (Sandbox Code Playgroud)

但是,我不断收到"此网页有太多重定向"错误.我如何防止这种情况发生?

Ous*_*ama 19

试试这个 :

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^secureform\.html$ https://www.example.com/secureform.html [L,R=301]
Run Code Online (Sandbox Code Playgroud)