[英]Unable to Access WordPress admin after moving to root domain
I have a website launch on sub domain ( sub.domain.com
) and all working fine there. 我在子域(
sub.domain.com
)上启动了一个网站,并且在那里一切正常。 I transferred it to root address ( domain.com
) by following steps. 我通过以下步骤将其转移到了根地址(
domain.com
)。
sub.domain.com
install of WordPress. sub.domain.com
安装的已下载数据库脚本。 sub.domain.com
to domain.com
by notepad sub.domain.com
地址替换为domain.com
wp-config.php
of root domain's WordPress. wp-config.php
中添加了凭据。 The issue now I am facing is that it when I try to access the /wp-admin
of new root domain's WordPress it doesnot accept them. 我现在面临的问题是,当我尝试访问新的根域的WordPress的
/wp-admin
,它不接受它们。
I created a admin user directly into db from this site , but it also is not working. 我直接从此站点向db创建了一个管理员用户,但它也无法正常工作。
Whenever you move a WordPress site, you need to properly adjust configurations in your WordPress install in the wp-config.php
file on the following variables: 每当您移动WordPress网站时,都需要在以下变量的
wp-config.php
文件中正确调整WordPress安装中的配置:
define('WP_SITEURL', 'http://domain.com/wordpress');
define('WP_HOME', 'http://domain.com/');
define('WP_CONTENT_DIR', '/path/to/your/wordpress/wp-content');
define('WP_CONTENT_URL', 'http://domain.com/wp-content');
This will force your install to use the domain.com
URLs. 这将强制您的安装使用
domain.com
URL。 Also, when you do this the first time set the RELOCATE
setting to true
like this: 另外,第一次执行此操作时,将
RELOCATE
设置设置为true
如下所示:
define('RELOCATE', true);
That basically tells WordPress to rejigger (that's my technical term for it) it's stored settings for the new settings. 这基本上告诉WordPress重新启动(这是我的技术术语),它存储了新设置的设置。 And after you have reloaded your site & it works as expected, set
RELOCATE
setting back to false
like this: 重新加载网站并按预期工作后,将
RELOCATE
设置重新设置为false
如下所示:
define('RELOCATE', false);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.