.htaccess htaccess链重定向仅适用于http协议。如何修复?

.htaccess htaccess链重定向仅适用于http协议。如何修复?,.htaccess,.htaccess,我需要将所有页面重定向到新域。从domain.biz到domain2.org。 htaccess重定向可以工作,但当出现重定向问题时,它会按以下方式重定向 ->-> 如何避免双重重定向并使其-> 这是我的访问权限 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.biz$ [OR] RewriteCond %{HTTP_HOST} ^www.domain.biz$ Re

我需要将所有页面重定向到新域。从domain.biz到domain2.org。 htaccess重定向可以工作,但当出现重定向问题时,它会按以下方式重定向 ->->

如何避免双重重定向并使其->

这是我的访问权限

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^domain.biz$ [OR]
  RewriteCond %{HTTP_HOST} ^www.domain.biz$
  RewriteRule (.*)$ https://domain2.org/$1 [R=301,L]
</IfModule>

<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:X-Forwarded-Proto} =https [NC]
    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]
    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}.xml%{ENV:W3TC_ENC}" -f
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.xml%{ENV:W3TC_ENC}" [L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>




重新启动发动机
RewriteCond%{HTTP_HOST}^domain.biz$[或]
重写cond%{HTTP_HOST}^www.domain.biz$
重写规则(.*)$https://domain2.org/$1[R=301,L]
重新启动发动机
重写基/
RewriteCond%{HTTPS}=on
重写规则。*-[E=W3TC\U SSL:\U SSL]
RewriteCond%{SERVER_PORT}=443
重写规则。*-[E=W3TC\U SSL:\U SSL]
RewriteCond%{HTTP:X-Forwarded-Proto}=https[NC]
重写规则。*-[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]
重写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}.xml%{ENV:W3TC u ENC}”-f
重写规则。*“/wp content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/{index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.xml%{ENV:W3TC_ENC}”[L]
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]

初始重定向不是由您发布的指令引起的。(确保已清除浏览器缓存。)我使用2个第三方工具检查重定向,因此问题不在缓存中。请删除重定向指令周围的
包装。有错误吗?
.htaccess
文件中没有任何内容会重定向
http://domain.biz
->
http://www.domain.biz
-因此您需要找到发生这种情况的地方。它发生在服务器配置中,在处理
.htaccess
之前,或者未处理
.htaccess
文件(或者未启用mod_rewrite),并且重定向由应用程序触发(WordPress?)。