我找到了如何使用htaccess将某些页面重定向到https和其他所有页面到http的解决方案请查看下面的答案以获取更多详细信息
答案 0 :(得分:0)
Please use bellow .htaccess rules to redirect some pages to https and other pages to http,
RewriteEngine On
# Force SSL on my-listing and add listing pages
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (my-listing|new|choose-listing-type-plans)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Remove SSL on other pages
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|css|js|woff|ttf|ico|php|txt|svg) [NC]
RewriteCond %{REQUEST_URI} !(my-listing|new|choose-listing-type-plans)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Thanks,
<h1>Nilesh G. Pangul</h1>
@http://www.facebook.com/nileshgpangul