将包含特定字符串的网址重定向到https

问题描述:

我想使用htaccess将我的会员注册网址重定向到HTTPS。所以: http://example.com/product/register/ *将包含特定字符串的网址重定向到https

...而且在任何页面即如: http://example.com/product/register/details http://example.com/product/register/payment

我尝试以下,但我不知道,我甚至在正确的轨道:

RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteCond $1 ^(register/*) [NC] 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

任何帮助表示赞赏。

有这样说:

RewriteEngine On 

RewriteCond %{HTTPS} off 
RewriteCond %{THE_REQUEST} /product/register/ [NC] 
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]