为几个页面设置 SSL


Setting SSL for a few pages

目前,我网站上的所有内容都重定向到https。这太好了。我很想使用SSL。但是现在,并非所有内容都使用SSL,因此我想慢慢传输所有内容。所以我想要几页(注册.html,注册.php,文本限制.html,文本限制.php)。这将不胜感激。

我的 .htaccess 目前是

SetEnv TZ America/Los_Angeles
# Prevent viewing of htaccess file.
<Files .htaccess>
    order allow,deny
    deny from all
</Files>
# Prevent directory listings
Options All -Indexes
# Compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

您可以在下面添加RewriteCond %{HTTPS} off

RewriteCond %{REQUEST_URI} ^/(?:register'.html|register'.php|textlimit'.html|textlimit'.php)$

或者,如果您想稍后添加更多内容,请使用更简单的格式:

RewriteCond %{REQUEST_URI} ^/(?:register'.html|register'.php)$ [OR]
RewriteCond %{REQUEST_URI} ^/(?:textlimit'.html|textlimit'.php)$ [OR]
RewriteCond %{REQUEST_URI} ^/other'.html$ [OR]
RewriteCond %{REQUEST_URI} ^/other2'.html$