Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.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
Php 正在尝试禁用wordpress重定向到https_Php_Wordpress_Nginx - Fatal编程技术网

Php 正在尝试禁用wordpress重定向到https

Php 正在尝试禁用wordpress重定向到https,php,wordpress,nginx,Php,Wordpress,Nginx,我希望建立一个wordpress网站的测试版本,而不是 https,因此我可以修复自发布以来出现的各种问题 移动到新的托管服务 测试站点正在重定向到https-它返回指向活动域的301 我正在使用nginx,因此.htaccess文件被忽略(这是其他问题的根源) 该站点确实正确地提供了非php内容和带有phpinfo()的.php文件 在它里面,发球是正确的。因此,这似乎是wordpress或插件问题 所以我重命名了插件目录,禁用所有插件并重新启动,重定向仍然发生!我已清除nginx的缓存和浏览

我希望建立一个wordpress网站的测试版本,而不是 https,因此我可以修复自发布以来出现的各种问题 移动到新的托管服务

测试站点正在重定向到https-它返回指向活动域的301

我正在使用nginx,因此.htaccess文件被忽略(这是其他问题的根源)

该站点确实正确地提供了非php内容和带有phpinfo()的.php文件 在它里面,发球是正确的。因此,这似乎是wordpress或插件问题

所以我重命名了插件目录,禁用所有插件并重新启动,重定向仍然发生!我已清除nginx的缓存和浏览器的缓存

如何进一步诊断该问题?下面我复制了测试站点的nginx配置

thebe上testdomain.com的语句。 服务器{ 服务器名称testdomain.com; 听80

fastcgi_read_timeout  300;

root /home/ian/websites/testdomain/htsecure;
index index.php;
fastcgi_index index.php;
#
access_log /var/log/nginx/testdomain.access.log;
error_log  /var/log/nginx/error.log;
#
location = /favicon.ico {
    log_not_found off;
    access_log off;
}
# disallow hot linking to images 
location ~ .(gif|png|jpg|jpeg)$ {
    valid_referers none blocked testdomain.com;
    if ($invalid_referer) {
        return 403;
    }
}
# server static files that exist
location / {
    try_files $uri $uri/ /index.php?$args;
}
# send .php files to fastcgi 
location ~ \.php$ {
   # Zero-day exploit defense - http://forum.nginx.org/read.php?2,88845,page=3
   try_files $uri  =404;   # only if they exist! 
   fastcgi_split_path_info ^(.+\.php)(/.+)$;
   fastcgi_param SCRIPT_FILENAME $document_root@fastcgi_script_name;
   include /etc/nginx/fastcgi.conf;
   fastcgi_pass 127.0.0.1:9000;
}

}

通过在
wp config.php
文件(位于根目录中)中添加以下行,使用非https域配置Wordpress:

背景

重定向可能由以下几方面引起:

  • 您的浏览器已缓存重定向(请尝试从其他浏览器加载网站)
  • 您的DNS配置不正确(此处的问题不太可能)
  • 您的web服务器(nginx)正在通过其全局配置、虚拟主机配置或(如果使用apache)目录级配置(如果您可以加载其他PHP文件而不进行重定向,则可能不是nginx问题)执行重定向
  • 您的PHP代码正在执行重定向。。。可能在Wordpress的任何地方

  • 理想情况下,Wordpress不会通过一些模糊的代码随意执行重定向——因此,禁用所有插件应该会停止重定向。然而,您可能错过的一个重定向是Wordpress本身立即执行的重定向,以强制站点仅从服务器加载。

    您应该更新数据库中的URL设置。例如,您可以使用此链接-。我希望它能帮助你

    define( 'WP_HOME', 'http://example.com' );
    define( 'WP_SITEURL', 'http://example.com' );