.htacess复杂和棘手的重定向 [英] .htacess complex and tricky redirection

查看:187
本文介绍了.htacess复杂和棘手的重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是专家.htacess我需要有点复杂和棘手的帮助.. !!

I am not expert in .htacess that my need bit complex and tricky help..!!

下面是我当前的 .htacess 并记住我需要一些 .htacess ,可以摧毁我的电流 .htacess

Here is my current .htacess and remember i need some .htacess that can destroy my current .htacess.

电流 .htacess

RewriteRule ^join$  https://domain.com/internalpath/join/index.php [L,QSA]
RewriteRule ^join/(.*)$ https://domain.com/internalpath/join/$1 [L,QSA]

现在我的问题:

我想每一个文件和目录HTTP重定向,除了这两个:

I want to redirect each and every file and directories to HTTP, except these two:

https://domain.com/join/

https://domain.com/join

记住,我要在http每一个环节,除了这上面提供的链接,其他则所有的文件和目录,甚至文件和/加盟/或/加盟将是HTTP,在HTTP上只有两个链接目录,但请它不会摧毁previous书面.htacess。

Remember, I want every link on http except this above provided link, other then all files and directories and even files and directories in /join/ or /join will be HTTP, just two links on HTTP, but please it will not destroy the previous written .htacess.

推荐答案

您需要这三个规则:

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule ^(join/.+)$ https://%{HTTP_HOST}/internalpath/$1 [R=301,NC,L]

RewriteCond %{HTTPS} off
RewriteRule ^(join)/?$ https://%{HTTP_HOST}/internalpath/$1/index.php [R=301,NC,L]

RewriteCond %{HTTPS} on
RewriteRule !^join http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]

这篇关于.htacess复杂和棘手的重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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