Wordpress - ftp'​​d 站点/导出的数据库到本地主机,本地主机图像仍然指向 .com,为啥?

Posted

技术标签:

【中文标题】Wordpress - ftp\'​​d 站点/导出的数据库到本地主机,本地主机图像仍然指向 .com,为啥?【英文标题】:Wordpress - ftp'd site/exported database to localhost, localhost images still point to .com, why?Wordpress - ftp'​​d 站点/导出的数据库到本地主机,本地主机图像仍然指向 .com,为什么? 【发布时间】:2013-02-24 19:56:09 【问题描述】:

我在整个 wordpress 站点上进行了 FTP 传输,并导出了数据库并通过 WAMP 在我的本地主机上运行,​​但由于某种原因,链接和文件夹仍然指向它的 .com,并且还会出现 404 错误.

我怀疑它与 .htaccess 有关,但我不确定.. 有人可以引导我走向正确的方向吗?

【问题讨论】:

【参考方案1】:

您是否在常规>设置下更新了 WordPress 地址 (URL) 和站点地址 (URL)?

它们可能仍指向旧域。

【讨论】:

【参考方案2】:

通过 FTP 将站点传输到本地计算机与将站点“移动”到新域相同。 Wordpress 提供了此类移动的具体说明,您可以找到 @

http://codex.wordpress.org/Moving_WordPress

When Your Domain Name or URLs Change When your domain name or URLs change - i.e. from http://example.com/blog to http://example.com, or http://example.com to http://newexample.com - there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.

If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:

Only perform a search and replace on the wp_posts table. Use the Search and Replace for WordPress Databases Script to safely change all instances. ( If you are a developer, use this option. It is a one step process as opposed to the 15-step procedure below )

【讨论】:

以上是关于Wordpress - ftp'​​d 站点/导出的数据库到本地主机,本地主机图像仍然指向 .com,为啥?的主要内容,如果未能解决你的问题,请参考以下文章

text 如何为通过MAMP运行的本地WordPress站点设置FTP访问

迁移后 Wordpress 不断重定向到 install-php

wordpress可以搭建两个网站吗,比如一个博客一个视频

如何从 Web 矩阵中导出 wordpress 数据库

我想在本地主机 xampp 上恢复 wordpress 站点备份

站点搭建从零開始 WordPress的安装