问题,我试图让一对夫妇目录永远是HTTPS和一切为:http与htaccess的重写
带图像,CSS文件,这应该是对任何js文件之外的页面上。
所以我创造了这个htaccess的重写:
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://server.com/$1 [R=301,L]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^login/(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule \.(gif|jpe?g|png|css|js)$ - [NC,L]
RewriteCond %{HTTP:X-Forwarded-Proto} https
RewriteCond %{REQUEST_URI} !^login/(.*)$
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
但是,当我去/登录我得到一个错误
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
什么需要改变这种正常工作?
是'%{HTTP:X-转发 - 协议}'支持你的Apache? – anubhava
是的,它运行在AWS Load Balanced Beanstalk上,所以我必须使用该方法进行比较。 –