我正在尝试对我拥有的WordPress网站进行新更改.因此,我复制了所有文件并导出到新的开发子域.为子域创建新数据库,并从实时站点导入数据库.
I'm trying to make new changes to a WordPress site I have. So I copied all files and exported to new development sub-domain. Made new database for the sub-domain and imported the database from live site.
实时网站: mysite
开发站点: dev.mysite
似乎可以正常使用,但所有导航链接仍指向实际站点.而主要问题是当我转到 dev.mysite/wp-admin 时,我被重定向到实时站点.这是我要重定向到的链接:
Seems to be working, but all nav links still point to live site. And main issue is when I go to dev.mysite/wp-admin, I get redirected to live site. This is link I'm getting redirected to:
mysite/wp-login.php?redirect_to=http%3A%2F%2Fdev.mysite%2Fwp-admin%2F&reauth=1
有什么想法吗?
谢谢
推荐答案上面的答案是正确的,大多数情况下,在wp_options表中编辑"home"和"site" URL可以解决问题,但是有时有必要在数据库上进行搜索和替换(使用后果自负):
The answers above are correct, most of the time editing the 'home' and 'site' url in the wp_options table will do the trick, however sometimes it's necessary to run a search and replace on the database (use at your own risk):
interconnectit/products/search-and -replace-for-wordpress-databases/
过去,这对我来说非常有效.
This has worked very well for me in the past.
此外,通过转到设置"->永久链接"并仅单击保存"来更新永久链接设置通常会解决网址问题.
Also, updating your permalink settings by going to Settings->Permalinks and just clicking 'Save' will often fix url problems.
编辑
或者,由于您无权访问wp-admin来更新永久链接,因此您可以尝试以下操作:
Alternatively, since you do not have access to wp-admin for updating permalinks, you can try this:
编辑wp-config.php并添加以下内容:
define('WP_HOME','example'); define('WP_SITEURL','example');其中 example 是您的网站网址.
紧接在就这样,停止编辑!"之后插入此行:
Directly after "That's all, stop editing!" insert this line:
define('RELOCATE',true);
然后,导航至 example/wp-login.php
请让我知道是否可行.
更多推荐
开发WordPress管理员链接重定向到实时站点
发布评论