我有一个ssl的网站,只适用于非www版本。是否可以使用htacess将除了结帐页面之外的所有网址重定向到www版本,并在结帐页面上添加https://
由于
答案 0 :(得分:0)
说明您的结帐页面位于https://domain.com/checkout.php
尝试:
RewriteEngine On
# redirect non-www hostname to www hostname, but not /checkout.php
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule !^/?checkout.php http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# if checkout.php, redirect if not HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^/?checkout.php https://domain.com%{REQUEST_URI} [L,R=301]