开发者

.htaccess - help with a rewrite rule for ssl

开发者 https://www.devze.com 2023-01-13 20:03 出处:网络
So I\'ve got a website and an SSL certificate. Everything is set up and working, however, both http://example.com/checkout and https://example.com/checkout work. I\'m hoping there\'s a way to write a

So I've got a website and an SSL certificate. Everything is set up and working, however, both http://example.com/checkout and https://example.com/checkout work. I'm hoping there's a way to write a rule where anything going t开发者_如何学编程o /checkout is rerouted to https.

Ideas?


Try this:

RewriteCond %{HTTPS} off
RewriteRule ^checkout$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
0

精彩评论

暂无评论...
验证码 换一张
取 消