Apache .htaccess http www或非www重定向到https #开始WordPress 重新启动发动机 重写基/ 重写规则^index\.php$-[L] 重写cond%{REQUEST_FILENAME}-F 重写cond%{REQUEST_FILENAME}-D 重写规则/index.php[L] #结束WordPress 重新启动发动机 重新启动发动机 重写cond%{HTTPS}关闭[或] 重写cond%{HTTP_HOST}^www\。[北卡罗来纳州] 重写cond%{HTTP_HOST}^(?:www\)?(.+)$[NC] 重写规则^https://%1%{REQUEST_URI}[L,NE,R=301]
这是Apache .htaccess http www或非www重定向到https #开始WordPress 重新启动发动机 重写基/ 重写规则^index\.php$-[L] 重写cond%{REQUEST_FILENAME}-F 重写cond%{REQUEST_FILENAME}-D 重写规则/index.php[L] #结束WordPress 重新启动发动机 重新启动发动机 重写cond%{HTTPS}关闭[或] 重写cond%{HTTP_HOST}^www\。[北卡罗来纳州] 重写cond%{HTTP_HOST}^(?:www\)?(.+)$[NC] 重写规则^https://%1%{REQUEST_URI}[L,NE,R=301],apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,这是.htaccess中的规则,类似于http://example.com/test,http://www.example.com/test不重定向到https,www重定向到非https地址http://example.comurl已正确重定向。怎么了?重新启动引擎 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] Rewr
.htaccess
中的规则,类似于http://example.com/test
,http://www.example.com/test
不重定向到https,www重定向到非https地址<代码>http://example.comurl已正确重定向。怎么了?重新启动引擎
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteEngine On
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
重写cond%{HTTPS}关闭[或]
重写cond%{HTTP_HOST}^www\。[北卡罗来纳州]
重写cond%{HTTP_HOST}^(?:www\)?(.+)$[NC]
重写规则^https://%1%{REQUEST_URI}[L,NE,R=301]
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
规则移到顶部,工作正常。这种重写在这里单独解释了大约6395609210438次。确定所有这些答案都没有帮助吗?是的,当然。我修正了,把规则移到最上面。
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress