一些重定向到URL在.htaccess中HTTPS [英] Redirect some url to https in .htaccess

查看:205
本文介绍了一些重定向到URL在.htaccess中HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想,这个URL重定向可以到https:

  www.example.com/iscrizioni
www.example.com/inscripciones
www.example.com/inscripcions

和其他所有为http

我怎么能在htaccess的做到这一点?

问候


解决方案

  RewriteEngine叙述在的RewriteCond%{HTTP_HOST} ^(WWW \\)?例如\\ $ .COM [NC]
的RewriteCond%{} HTTPS关闭
?重写规则^ /(iscrizioni | inscripciones | inscripcions)的https://www.example.com% {REQUEST_URI} [L,R]的RewriteCond%{HTTP_HOST} ^(WWW \\)?例如\\ $ .COM [NC]
的RewriteCond%{} HTTPS上
!?重写规则^ /(iscrizioni | inscripciones | inscripcions)HTTP://www.example.com% {REQUEST_URI} [L,R]

I want that this url be redirect to https:

www.example.com/iscrizioni
www.example.com/inscripciones
www.example.com/inscripcions

and all others to http

How I can do it in htaccess?

Regards

解决方案

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteCond %{HTTPS} off
RewriteRule ^/?(iscrizioni|inscripciones|inscripcions) https://www.example.com%{REQUEST_URI} [L,R]

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteCond %{HTTPS} on
RewriteRule !^/?(iscrizioni|inscripciones|inscripcions) http://www.example.com%{REQUEST_URI} [L,R]

这篇关于一些重定向到URL在.htaccess中HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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