Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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 HttAccess http到https重定向不影响根目录_Wordpress_.htaccess_Redirect_Mod Rewrite - Fatal编程技术网

Wordpress HttAccess http到https重定向不影响根目录

Wordpress HttAccess http到https重定向不影响根目录,wordpress,.htaccess,redirect,mod-rewrite,Wordpress,.htaccess,Redirect,Mod Rewrite,这个问题困扰了我一段时间了。我们正在尝试从http://重定向到https://,并从ourdomain.co.uk重定向到www.ourdomain.co.uk https和www重定向适用于每个页面。但是当访问根url时,https不被应用http://www.ourdomain.co.uk http://ourdomain.co.uk被重定向到https://...没有任何问题 这可能是什么原因造成的?我是.htaccessn00b,但我们使用的所有东西都与我通过搜索问题找到的所有建议相匹

这个问题困扰了我一段时间了。我们正在尝试从
http://
重定向到
https://
,并从
ourdomain.co.uk
重定向到
www.ourdomain.co.uk

https
www
重定向适用于每个页面。但是当访问根url时,
https
不被应用http://www.ourdomain.co.uk

http://ourdomain.co.uk
被重定向到
https://...
没有任何问题

这可能是什么原因造成的?我是
.htaccess
n00b,但我们使用的所有东西都与我通过搜索问题找到的所有建议相匹配

这是我们的
.htaccess
的开始:

# FIX for Wordpress menu limit
<IfModule mod_php5.c>
php_value max_input_vars 6000
</IfModule>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

# Force https
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Force www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Force traing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]

RewriteBase /
RewriteRule ^index\.php$ - [L]

### more page-by-page redirects go here ###
#修复Wordpress菜单限制
php_值最大输入值为6000
#开始WordPress
重新启动发动机
#强制https
重写cond%{HTTPS}=在…上
重写规则^https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
#强制www。
重写cond%{HTTP_HOST}^www\。
重写规则。*https://www.%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
#强制训练斜线
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*[^/])$/$1/[L,R=301]
重写基/
重写规则^index\.php$-[L]
###更多逐页重定向转到此处###