Google 코드는 두 개의 다른 서버에서 실행됩니다. 하나는 https가 활성화되어 있고 다른 하나는 ("유산") 않습니다. SSL 서버에서만 https를 강제 실행하려고합니다..htaccess http -> https 재 작성 규칙으로 인한 리디렉션 루프
다음 코드를 추가했지만 리디렉션 루프가 발생했습니다. 다음은
#Force SSL for everyone but legacy production
RewriteCond %{HTTP_HOST} !legacy\.site\.com
RewriteCond %{HTTPS} !=on
#RewriteCond %{SERVER_PORT} !=443 #<--this also causes redirect loop
#RewriteCond %{REQUEST_SCHEME} != https #<--this causes a 500 error!
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
(나는이 문제를 생각하지 않습니다하지만 난 완성도를 포함하고 있습니다) 다음입니다 :
#gzip
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 $1 !^(index\.php|public|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
이유는 무엇입니까? https://blog.heroku.com/archives/2012/5/3/announcing_better_ssl_for_your_app이
'legacy.site.com'에 가지 않는 한이 반복은 안될까요? 어떤 가상 호스트가 이것입니까? 루프를 가져올 때 사용할 사이트의 이름은 무엇입니까? 'site.com'? 'subdomain.site.com'? – arco444
.htaccess에 더 많은 규칙이 있습니까? – anubhava
@ arco444 두 번째 조건이 실패해야 함을 의미하는'https'로 리다이렉트하므로 루핑을 계속해야한다고 생각하지 않습니다. 루프를 가져 오는 URL은'new.site.com'입니다. – emersonthis