讓我帶你到This page with HTTPS和this page without。這是一個Wordpress網站,不管怎樣,URL(和鏈接到)都需要HTTPS://在前面,否則最終會出現一個空白頁面。爲什麼前面沒有「https://」的URL會導致空白頁面?
讓我們概括一下情況並澄清發生了什麼,因爲我不知道是什麼原因造成的。希望你們可以告訴我如何解決這個問題,所以沒有https://的URL仍然顯示相同的頁面?
可能的.htaccess/nginx.conf和重定向到 '以https://' 會做>
服務器運行的是NGINX
我的nginx.conf文件:
# HTTP -> HTTPS
server {
listen 80;
server_name ttr.nl www.ttr.nl;
return 301 https://ttr.nl$request_uri;
}
http {
client_max_body_size 100m;
}
# BEGIN W3TC Page Cache cache
location ~ /wp-content/cache/page_enhanced.*html$ {
expires modified 7200s;
add_header X-Powered-By "W3 Total Cache/0.9.4.1";
add_header Vary "Accept-Encoding, Cookie";
add_header Pragma "public";
add_header Cache-Control "max-age=7200, public";
}
location ~ /wp-content/cache/page_enhanced.*gzip$ {
gzip off;
types {}
default_type text/html;
expires modified 7200s;
add_header X-Powered-By "W3 Total Cache/0.9.4.1";
add_header Vary "Accept-Encoding, Cookie";
add_header Pragma "public";
add_header Cache-Control "max-age=7200, public";
add_header Content-Encoding gzip;
}
# END W3TC Page Cache cache
# BEGIN W3TC Browser Cache
gzip on;
gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location ~ \.(css|htc|less|js|js2|js3|js4)$ {
expires 2592000s;
add_header Pragma "public";
add_header Cache-Control "max-age=2592000, public";
add_header X-Powered-By "W3 Total Cache/0.9.4.1";
}
location ~ \.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ {
expires 7200s;
add_header Pragma "public";
add_header Cache-Control "max-age=7200, public";
add_header X-Powered-By "W3 Total Cache/0.9.4.1";
}
location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|woff|xla|xls|xlsx|xlt|xlw|zip)$ {
expires 31536000s;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public";
add_header X-Powered-By "W3 Total Cache/0.9.4.1";
}
# END W3TC Browser Cache
# BEGIN W3TC Page Cache core
set $w3tc_rewrite 1;
if ($request_method = POST) {
set $w3tc_rewrite 0;
}
if ($query_string != "") {
set $w3tc_rewrite 0;
}
if ($request_uri !~ \/$) {
set $w3tc_rewrite 0;
}
if ($http_cookie ~* "(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle)") {
set $w3tc_rewrite 0;
}
if ($http_cookie ~* "(w3tc_preview)") {
set $w3tc_rewrite _preview;
}
set $w3tc_ssl "";
if ($scheme = https) {
set $w3tc_ssl _ssl;
}
set $w3tc_enc "";
if ($http_accept_encoding ~ gzip) {
set $w3tc_enc _gzip;
}
set $w3tc_ext "";
if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_ssl$w3tc_rewrite.html$w3tc_enc") {
set $w3tc_ext .html;
}
if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_ssl$w3tc_rewrite.xml$w3tc_enc") {
set $w3tc_ext .xml;
}
if ($w3tc_ext = "") {
set $w3tc_rewrite 0;
}
if ($w3tc_rewrite = 1) {
rewrite .* "/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_ssl$w3tc_rewrite$w3tc_ext$w3tc_enc" last;
}
# END W3TC Page Cache core
#gzip via varvy.com
聽起來確實像一個htaccess問題。前一段時間我和我的SMF論壇有同樣的問題,那就是問題所在。 –
期望的結果是重定向非https https?或者使http和httpS工作?無論哪種方式,請發佈您的htaccess文件 –
我希望我的網站僅使用SSL,無論您將「https://」放在URL前面,它都應該可以正常工作。 –