Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.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 Https重定向工作错误_Wordpress_Http_Ssl_Http Redirect_Https Redirect - Fatal编程技术网

Wordpress Https重定向工作错误

Wordpress Https重定向工作错误,wordpress,http,ssl,http-redirect,https-redirect,Wordpress,Http,Ssl,Http Redirect,Https Redirect,我们的Wordpress网站上的HTTP链接存在问题,重定向到HTTPS页面的规则无法打开正确的链接。 即:重定向到 未注明:(“/”缺失) 我只有FTP和Wordpress访问权限: .htaccess文件: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] Header always set Content-Security

我们的Wordpress网站上的HTTP链接存在问题,重定向到HTTPS页面的规则无法打开正确的链接。 即:重定向到 未注明:(“/”缺失) 我只有FTP和Wordpress访问权限:

.htaccess文件:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Header always set Content-Security-Policy "upgrade-insecure-requests;"

# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<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
重新编写引擎打开
重写cond%{HTTPS}=在…上
重写规则^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301,NE]
标头始终设置内容安全策略“升级不安全请求
#开始WordPress
#“BEGIN WordPress”和“END WordPress”之间的指令(行)是
#动态生成,只能通过WordPress过滤器修改。
#这些标记之间对指令的任何更改都将被覆盖。
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
非常感谢你的帮助。
:)

查看以下回复:

本质上,
.htaccess
文件的位置将指示前缀斜杠。尝试在重定向链接中显式添加斜杠,如下所示:

   RewriteRule ^(.*)$ https://%{HTTP_HOST}/%{REQUEST_URI} [L,R=301,NE]

谢谢你的帮助!我按照你的建议添加了斜杠,但问题仍然存在!您是否尝试过:
RewriteRule^(.*)$https://%{HTTP\u HOST}/$1