将wordpress多站点移动到另一个域时出现错误
错误就像:只是重定向到旧站点或只是“未建立数据库连接”
我做了什么:
将网站的所有文件移至新主机
将数据库移至新主机,并将旧域重写为新域
更改了wp-config.php *
我多次移动了单个(非多站点)wordpress网站,所以我认为步骤1或/和2中的问题不存在,我认为wp-config或.htaccess中某些设置中的问题我试图更改这些问题设置,但它们不起作用
详细信息:
旧域为-> https://dearsystems.com
新域为-> http://dearsystems.chornatastudio.com
我当前的wp-config.php:
<?php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'XXXXXX');
/** MySQL database username */
define('DB_USER', 'XXXXXXX');
/** MySQL database password */
define('DB_PASSWORD', 'XXXXXXX');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** 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', '');
define('AUTH_KEY', 'XXXXXXX');
define('SECURE_AUTH_KEY', 'XXXXXXX');
define('LOGGED_IN_KEY', 'XXXXXXX');
define('NONCE_KEY', 'XXXXXXX');
define('AUTH_SALT', 'XXXXXXX');
define('SECURE_AUTH_SALT', 'XXXXXXX');
define('LOGGED_IN_SALT', 'XXXXXXX');
define('NONCE_SALT', 'XXXXXXX');
$table_prefix = 'redacted_';
define('WPLANG', '');
define('WP_DEBUG', false);
/* Multisite */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'dearsystems.chornatastudio.com');
define('PATH_CURRENT_SITE', '/inventory-software/');
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');
# Disables all core updates. Added by SiteGround Autoupdate:
define( 'WP_AUTO_UPDATE_CORE', false );
我的.htaccess文件:
RewriteEngine On
RewriteBase /inventory-software/
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]
# Added by Siteground Support Team
<IfModule mod_security.c>
SecFilterRemove 001566
</IfModule>
AddHandler application/x-httpd-php56 .php .php5 .php4 .php3
另外,可能会有所帮助: 当我将wp-config中的以下代码行(位于下面)更改为旧域时,它将我重新定向到旧站点:
define('DOMAIN_CURRENT_SITE', 'olddomain.com');
但是当我编写新域时-它向我显示错误“建立数据库连接时出错”
伙计们,非常感谢您提供任何帮助和想法