1

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

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

4

2 回答 2

1

通过 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 )

于 2013-03-09T06:57:53.667 回答
1

您是否在General > Settings下更新了 WordPress 地址 (URL) 和站点地址 (URL) ?

他们可能仍然指向旧域。

于 2013-03-09T07:59:27.383 回答