2017-02-10 78 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在最新的更新中添加了額外的安全級別,但我很高興它現在已經修復!