使用 .htaccess 控制某些页面上的 HTTPS [英] Using .htaccess to control HTTPS on certain pages
本文介绍了使用 .htaccess 控制某些页面上的 HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个需要(显然)HTTPS 进行结账的网站.当前实施的修复涉及使整个站点以 SSL 模式运行,但这会导致问题.
I've got a site that requires (obviously) HTTPS for checkout. The current fix put in place involved making the whole site run in SSL mode, but this is causing problems.
我将如何改变这个...
How would I change this...
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
仅将某个 URL(例如 bag.php)设置为 HTTPS?
To only set a certain URL (say basket.php) as HTTPS?
推荐答案
我相信这会奏效:
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} /basket.php
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
这篇关于使用 .htaccess 控制某些页面上的 HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文