当使用Apache加载相对URL作为HTTP HTTPS
问题描述:
我想在我的网站上使用SSL,但有一个相对URL负荷为http的recources://即使在页面使用https://
I am trying to use SSL on my website, but the recources that have a relative URL load as http:// even when the page is using https://
这是我的.htacces
This is my .htacces
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
RewriteRule ^(.*)$ – [F,L]
RewriteCond %{http_host} ^tacticalghillies.nl [NC]
RewriteRule ^(.*)$ http://www.tacticalghillies.nl/$1 [L,R=301]
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
我是谁搞砸了?
What am I screwing up?
答
很难理解所有的code。
Difficult to understand all your "code".
我想你可以添加在开头:
I think you can add in the beginning :
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]