使用的.htaccess控制HTTPS上某些网页网页、htaccess、HTTPS

2023-09-02 09:50:00 作者:未完的承诺

我有一个网站,需要(显然)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(比如basket.php)为HTTPS?

To only set a certain URL (say basket.php) as HTTPS?

推荐答案

我beleive这会工作:

I beleive this would work:

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} /basket.php
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]