重定向一个页面的HTTP到https [英] Redirect single page http to https

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

问题描述

我想从HTTP重定向一个页面使用的.htaccess HTTPS,但我不断收到重定向循环错误。

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

code:

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天全站免登陆