Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 插件访问重定向_Wordpress_.htaccess_Redirect_Mod Rewrite - Fatal编程技术网

Wordpress 插件访问重定向

Wordpress 插件访问重定向,wordpress,.htaccess,redirect,mod-rewrite,Wordpress,.htaccess,Redirect,Mod Rewrite,我有个问题。我在WordPress上安装了一个插件缓存,我在htacess文件中看到了这一点。这是否意味着如果我让我的网站上线,它将重定向到HTTPS?如果是这样,我如何才能阻止它 # BEGIN W3TC Page Cache core <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} =on RewriteRule .* - [E=W3TC_SS

我有个问题。我在WordPress上安装了一个插件缓存,我在htacess文件中看到了这一点。这是否意味着如果我让我的网站上线,它将重定向到HTTPS?如果是这样,我如何才能阻止它

# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} =on
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{SERVER_PORT} =443
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=W3TC_ENC:_gzip]
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
    RewriteRule .* - [E=W3TC_PREVIEW:_preview]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
</IfModule>
# END W3TC Page Cache core
#开始W3TC页面缓存核心
重新启动发动机
重写基/
RewriteCond%{HTTPS}=on
重写规则。*-[E=W3TC\U SSL:\U SSL]
RewriteCond%{SERVER_PORT}=443
重写规则。*-[E=W3TC\U SSL:\U SSL]
RewriteCond%{HTTP:Accept Encoding}gzip
重写规则。*-[E=W3TC\u ENC:\u gzip]
重写Cond%{HTTP_COOKIE}w3tc_预览[NC]
重写规则。*-[E=W3TC\u预览:\u预览]
重写cond%{REQUEST_METHOD}=邮递
RewriteCond%{QUERY_STRING}=“”
重写cond%{HTTP_COOKIE}!(注释|作者| wp \-postpass | w3tc |注销| wordpress |登录| wptouch |开关|切换)[NC]
重写cond“%{DOCUMENT_ROOT}/wp content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/{index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC u ENC}”-f
重写规则。*“/wp content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/{index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}”[L]
#结束W3TC页缓存核心
这是否意味着如果我让我的网站上线,它将重定向到HTTPS

您发布的代码中没有任何内容将重定向到HTTPS

如果通过HTTPS访问站点,则只需将环境变量
W3TC\u SSL
设置为“\u SSL”。如果通过HTTP访问站点,则不设置此变量。他们这样做可能是为了帮助构建指向缓存文件的URL

RewriteCond %{HTTPS} =on
RewriteRule .* - [E=W3TC_SSL:_ssl]
RewriteCond %{SERVER_PORT} =443
RewriteRule .* - [E=W3TC_SSL:_ssl]