Я хотел бы убедиться, что определенные URL-адреса на моем сайте всегда доступны через HTTPS, а все остальные URL-адреса доступны через HTTP.
Я могу заставить любой случай работать в моем файле .htaccess, однако если я включу оба, то я получу бесконечные перенаправления.
Мой файл .htaccess:
<IfModule mod_expires.c>
# turn off the module for this directory
ExpiresActive off
</IfModule>
Options +FollowSymLinks
AddHandler application/x-httpd-php .csv
RewriteEngine On
RewriteRule ^/?registration(.*)$ /register$1 [R=301,L]
# Force SSL for certain URL's
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (login|register|account)
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force non-SSL for certain URL's
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !(login|register|account)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force files ending in X to use same protocol as initial request
RewriteRule \.(gif|jpg|jpeg|jpe|png|ico|css|js)$ - [S=1]
# Use index.php as the controller
RewriteCond %{REQUEST_URI} !\.(exe|css|js|jpe?g|gif|png|pdf|doc|txt|rtf|xls|swf|htc|ico)$ [NC]
RewriteCond %{REQUEST_URI} !^(/js.*)$
RewriteRule ^(.*)$ index.php [NC,L]
Есть ли у кого-нибудь предложения о том, как заставить страницы входа в систему, регистрации и учетной записи быть https, а остальные страницы - нет?