WordPress多站点重定向循环

时间:2017-10-30 11:56:28

标签: php wordpress .htaccess redirect multisite

我对WordPress多站点有疑问。目前在子目录模式下有2个站点。一切正常,直到我想访问WordPress多站点网络选项卡,最终以" ERR_TOO_MANY_REDIRECTS "。我们有HTTPS和HTTP站点都在工作,但目前还没有强制重定向。

我们的.htacces看起来像是:

    # START XML RPC BLOCKING
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>
# FINISH XML RPC BLOCKING

#
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /


#RewriteCond %{SERVER_PORT} 80
#RewriteCond %{REQUEST_URI} www
#RewriteRule ^(.*)$ https://www.oursite.cz/$1 [R,L]

#RewriteCond %{HTTPS} !=on
#RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

RewriteRule ^index\.php$ - [L]
RewriteRule wp-content/thesis/skins/(.*)/css.css wp-admin/admin-post.php?action=thesis_do_css

# 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]
</IfModule>

和我们的wp-config.php是这样的:

/**
 * WordPress Localized Language, defaults to English.
 *
 * Change this to localize WordPress. A corresponding MO file for the chosen
 * language must be installed to wp-content/languages. For example, install
 * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
 * language support.
 */
//define('WPLANG', '');

/**
 * 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.
 */
define('WP_DEBUG', false);
define('FORCE_SSL_ADMIN', false);


/* Multisite */
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'www.oursite.cz');
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');

到目前为止,我们已经尝试过,但没有任何帮助:

  1. wordpress multisite concerns
  2. https://wordpress.org/support/topic/wp-multisite-too-many-redirects-on-wp-admin/
  3. 目前正在运行WordPress版本4.8.2,但WordPress已更新几次,并且Multisite很久以前就已创建(仍然存在同样的问题)。服务器是Apache 2.2.31和PHP 5.4.44。

    如果您能提供任何提示,我们将非常感激。

    提前致谢。

2 个答案:

答案 0 :(得分:0)

如果您正在使用Cloudflare,请从Cloudflare帐户的SSL / TLS选项卡中,选择“完全加密”。它将解决问题。

SSL TO FULL

答案 1 :(得分:0)

如果您最近移动了站点,请检查您的数据库以获取对旧域的引用并更新到新域。这包括从 http 迁移到 https。

您也可以尝试在 WordPress 仪表板 > 设置 > 永久链接 > 保存中更新永久链接