移动 wordpress 网站后链接断开

Broken links after moving wordpress site

我将我的 wordpress 网站从本地主机移至实时服务器。问题是我导航中的所有 links 都不能用作主页按钮。 实时站点 url:http://iulian.cablevision.ro 损坏 link 示例:http://iulian.cablevision.ro/about/

这是我得到的错误:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.27 (CentOS) Server at iulian.cablevision.ro Port 80

我尝试在我的数据库上使用 SQL 中的命令来更新 urls:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/wordpres/', 'www.iulian.cablevision.ro/');

我还尝试使用 Velvet Blues 插件,但效果不佳...是否有另一种操作数据库的方法,以便我的 link 能够正常工作? 我遵循了 http://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-from-local-server-to-live-site/ 的教程,但接缝对我不起作用...我的错误在哪里?

您的旧服务器不仅在 WP_POSTS table,而且在其他 table。在这里查看如何移动您的 wordpress 网站:

http://codex.wordpress.org/Moving_WordPress

Download your existing site files.
Export your database - go in to mySQL and export the database.
Move the backed up files and database into a new folder - somewhere safe - this is your site backup.
Log in to the site you want to move and go to Settings > General, then change the URLs. (ie from http://example.com/ to http://example.net ) - save the settings and expect to see a 404 page.
Download your site files again.
Export the database again.
Edit wp-config.php with the new server's mySQL database name, user and password.
Upload the files.
Import the database on the new server.

首先转到文件并重命名 htaccess 文件,然后检查您的实时站点。它会帮助您surely.and如果您有任何问题请详细描述

如果您使用默认结构以外的永久链接,首先您需要一个 .htaccess copy from here

既然你有 .htaccess,试试这个

  • 重新保存永久链接
  • 检查您的服务器是否启用了 mod_rewrite

我终于找到了解决方案。这是 .htacces 文件的问题...我犯的第一个错误是,当我将 .htacces 文件上传到服务器时,它上传为 simpe .txt 文件并且没有转换为 htacces 文件类型。所以我做了什么:

  • 创建了一个没有名称的简单文本文档并上传到服务器
  • 上传文件后,我将名称更改为 .htacces,这样文件转换就开始了。

在那之后我的链接就完美无缺了。 感谢你们顺便给我的支持。

为了在数据库迁移后修复所有链接,我使用 this tool。下载后,重命名文件夹,例如searchandreplace,将此文件夹添加到WP站点的根目录,访问它www.yoursite。com/searchandreplace,然后输入旧站点名称,并在替换输入中写入您的新名称,但是确保它们都使用相同的约定措辞,如果您写旧站点名称 www.oldsite.com,那么新名称也应该是 www.newsite.com,而不是 http://* 或添加的其他名称。如果问题仍然存在,希望这对您有所帮助。