2017-02-10 115 views
2

我有一个网站使用子目录设置运行多站点。我刚刚尝试更新我的网站到4.7.2和更新过程中,安装过程中没有发生错误,但然后安装完成后,我重定向到/wp-admin/network/about.php?updated它返回一个404页。所以然后我尝试回到/ wp-admin /并且出现重定向循环错误。WordPress 4.7.2多站点更新导致wp-admin重定向循环

我已经经历了至少40个不同的文章,论坛,以及关于WordPress多站点可湿性粉剂管理员重定向循环问题的网站看了看。我已经尽力解决了这个问题,但没有任何成效。主站点工作得很好,但wp-admin完全无法访问。

下面是到目前为止,我已经试过的东西:

  1. 我试图清除我的缓存和Cookie多次,并且该网站没有使用任何缓存插件
  2. 我改名为我的插件文件夹中的插件。去激活 只是要更彻底,我还更新了wp_options表中的active_plugins字段为:0:{}
  3. 我尝试从我的wp-config.php文件中删除多站点定义,但是当它没有任何作用时,我将它们放回
  4. 我确认我的.htaccess文件相匹配这里列出了3.5+多点之一 - https://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite
  5. 我也试了一下切换到旧版本,以防万一,但什么也没做,所以我切换回来。
  6. 我发现了一个论坛说,他们通过在/wp-admin/network/admin.php底部注释掉重定向固定的问题,所以我试过了,但什么也没做,所以我注释掉它恢复正常。
  7. 我发现另一个论坛说你需要在wp-config.php中定义cookie路径。所以我试图通过将下面的代码添加到我的wp-config.php中,但它没有工作,所以我删除了它。

的Cookie路径代码我想:

define('ADMIN_COOKIE_PATH', '/'); 
define('COOKIE_DOMAIN', ''); 
define('COOKIEPATH', ''); 
define('SITECOOKIEPATH', ''); 

这里是我的.htaccess文件:

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

# add a trailing slash to /wp-admin 
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule^- [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 
RewriteRule . index.php [L] 

这里是我的wp-config.php文件:

<?php 
/** 
* The base configuration for WordPress 
* 
* The wp-config.php creation script uses this file during the 
* installation. You don't have to use the web site, you can 
* copy this file to "wp-config.php" and fill in the values. 
* 
* This file contains the following configurations: 
* 
* * MySQL settings 
* * Secret keys 
* * Database table prefix 
* * ABSPATH 
* 
* @link https://codex.wordpress.org/Editing_wp-config.php 
* 
* @package WordPress 
*/ 

// ** MySQL settings - You can get this info from your web host ** // 
/** The name of the database for WordPress */ 
define('DB_NAME', 'DBNAME'); 

/** MySQL database username */ 
define('DB_USER', 'DBUNAME'); 

/** MySQL database password */ 
define('DB_PASSWORD', 'DBPASS'); 

/** MySQL hostname */ 
define('DB_HOST', 'DBHOST'); 

/** Database Charset to use in creating database tables. */ 
define('DB_CHARSET', 'utf8'); 

/** The Database Collate type. Don't change this if in doubt. */ 
define('DB_COLLATE', ''); 

/**#@+ 
* Authentication Unique Keys and Salts. 
* 
* Change these to different unique phrases! 
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} 
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. 
* 
* @since 2.6.0 
*/ 
define('AUTH_KEY',   'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 
define('SECURE_AUTH_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 
define('LOGGED_IN_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 
define('NONCE_KEY',  'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 
define('AUTH_SALT',  'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 
define('SECURE_AUTH_SALT', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 
define('LOGGED_IN_SALT', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 
define('NONCE_SALT',  'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); 

/** 
* Other customizations. 
*/ 
define('FS_METHOD','direct');define('FS_CHMOD_DIR',0777);define('FS_CHMOD_FILE',0666); 
define('WP_TEMP_DIR',dirname(__FILE__).'/wp-content/uploads'); 

/** 
* Turn off automatic updates since these are managed upstream. 
*/ 
define('AUTOMATIC_UPDATER_DISABLED', true); 


/**#@-*/ 

/** 
* WordPress Database Table prefix. 
* 
* You can have multiple installations in one database if you give each 
* a unique prefix. Only numbers, letters, and underscores please! 
*/ 
$table_prefix = 'XXXXXX'; 

/** 
* For developers: WordPress debugging mode. 
* 
* Change this to true to enable the display of notices during development. 
* It is strongly recommended that plugin and theme developers use WP_DEBUG 
* in their development environments. 
* 
* For information on other constants that can be used for debugging, 
* visit the Codex. 
* 
* @link https://codex.wordpress.org/Debugging_in_WordPress 
*/ 
define('WP_DEBUG', false); 

define('WP_ALLOW_MULTISITE', true); 
define('MULTISITE', true); 
define('SUBDOMAIN_INSTALL', false); 
define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']); 
define('PATH_CURRENT_SITE', '/'); 
define('SITE_ID_CURRENT_SITE', 1); 
define('BLOG_ID_CURRENT_SITE', 1); 

/* That's all, stop editing! Happy blogging. */ 

/** Absolute path to the WordPress directory. */ 
if (!defined('ABSPATH')) 
    define('ABSPATH', dirname(__FILE__) . '/'); 

/** Sets up WordPress vars and included files. */ 
require_once(ABSPATH . 'wp-settings.php'); 
+0

您是否收到此错误:'警告:mysql_real_escape_string()预计参数1是字符串,对象/ FILEPATH /可湿性粉剂包含/ WP-DB给出。php on line 1173' – scoopzilla

+0

我根本没有得到任何错误,只是太多的重定向错误页面。 –

+0

可能与我更新时遇到的不一样。 – scoopzilla

回答

0

我发现了这个问题!在尝试将全新的WordPress副本安装到新的子域并立即获得太多重定向错误后,我知道这个问题必须在服务器级别。

我检查了我的错误日志中的cPanel,并发现它每次我试图可湿性粉剂管理员访问任何东西,因为这些文件是可写的组0664的权限时抛出的错误。

我将wp-admin和wp-includes中的所有文件更改为0644权限和bam!现在一切正常!

如果您有太多的重定向问题以及检查您的错误日志。我不确定这是否仅仅是我的服务器,或者WP在最新的更新中添加了额外的安全级别,但我很高兴它现在已经修复!

相关问题