将单页 http 重定向到 https [英] Redirect single page http to https

查看:38
本文介绍了将单页 http 重定向到 https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to redirect a single page from http to https using .htaccess, but I keep getting a redirect loop error.

代码:

Redirect /secureform.html https://www.example.com/secureform.html

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

However, I keep getting a "this webpage has too many redirects" error. How do I keep this from happening?

推荐答案

试试这个:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^secureform.html$ https://www.example.com/secureform.html [L,R=301]

这篇关于将单页 http 重定向到 https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆