Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 views
in Technique[技术] by (71.8m points)

mod rewrite - Using .htaccess to control HTTPS on certain pages

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]

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

A shorter version:

RewriteCond %{HTTPS} off
RewriteRule ^basket.php$ https://%{HTTP_HOST}%{REQUEST_URI} [L]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...