使用htaccess为单页禁用https [英] disable https for single page with htaccess
本文介绍了使用htaccess为单页禁用https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试了一些htaccess语句,但对我不起作用.我需要将整个站点与https一起使用,除了一个页面需要从另一个站点进行http连接之外,因此我需要为此页面禁用https.
I have tried some htaccess senteces but it doesn't work for me. I need to use whole site with https except one page it requires http connection from another site so i need to disable https for this page.
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{HTTPS} on
RewriteCond %{SCRIPT_FILENAME} \/exp\.php [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,NC]
浏览器说似乎重定向过多.
browser says it seems there is too many redirections.
推荐答案
您可以使用以下代码:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} ^off$
RewriteCond %{REQUEST_URI} !exp\.php$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
这篇关于使用htaccess为单页禁用https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文