내 사이트의 특정 URL은 항상 HTTPS를 통해 액세스되고 다른 모든 URL은 HTTP를 통해 액세스되도록하고 싶습니다.일부 URL에 대해 SSL을 강제 적용하고 다른 모든 SSL에 대해 강제로 SSL을 적용하지 않으려면 어떻게해야합니까?
두 경우 모두 내 .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를로, 로그인을 강제 할 수있는 방법에 대한 제안 사항이 있습니까?
어떤 URL이 inifinite 리디렉션을 유발? 다시 쓰기 로그의 출력은 무엇입니까? – Artefacto
당신은 "다른"페이지에 있다는 것을 서버가 알고 있기 때문에 SSL의 모든 고된 작업이 완료되고 비 SSL로 강제하는 것은 추가 작업에 지나지 않음을 알아야합니다. – Jumbogram