力HTTP,而不是HTTPS只为一个特定的文件只为、而不是、文件、HTTP

由网友(婚纱和她只是梦)分享简介:对于一个特定的文件,我想迫使http来代替https For a particular file, I want to force http instead of https例如:https://example.com/test.php?parameter1=value1应该发送到http://example....

对于一个特定的文件,我想迫使http来代替https

For a particular file, I want to force http instead of https

例如:

https://example.com/test.php?parameter1=value1

应该发送到

http://example.com/test.php?parameter1=value1

我怎样才能做到这一点?

How can I achieve this?

推荐答案

您的问题不是很清楚,但试试这个的.htaccess code:

Your question is not very clear but try this .htaccess code:

Options +FollowSymLinks -MultiViews
RewriteEngine on

RewriteCond %{QUERY_STRING} ^parameter1=.*$ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule ^test.php/?$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA,NC]

这将重定向只有当查询字符串参数1 =东西是present在原来的网址。如果你想重定向所有 /test.php 的URI为https然后取出1号线的RewriteCond

This will redirect ONLY if QUERY string parameter1=something is present in the original URL. If you want to redirect all /test.php URIs to https then remove the 1st RewriteCond line.

阅读全文

相关推荐

最新文章