从的.htaccess HTTP重定向://www.domain/到https://domain.com [英] .htaccess redirect from http://www.domain/ to https://domain.com

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

问题描述

我(有htaccess文件)如何可以重定向页面,看起来像这样:

How can I (with a htaccess file) redirect a page that looks like this:

http://www.domain/page/?var=test&var2=test2

要的东西,看起来像这样:

To something that looks like this:

 https://domain/page/?var=test&var2=test2

但做到这一点,因此只​​影响到本页并没有别的?

But do it so it only affects this page and nothing else?

推荐答案

试试这个

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

这篇关于从的.htaccess HTTP重定向://www.domain/到https://domain.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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