【发布时间】:2019-06-20 13:35:47
【问题描述】:
当我将 WordPress 站点从一台服务器迁移到另一台服务器时。未找到页面,访问页面时出现错误。我已经更新了 wp-config、.htaccess 文件,还使用表格中的新站点 URL 更改了链接和 URL。
我已按照以下步骤操作:
wp-config.php
define( 'DB_NAME', 'my-db-name' );
define( 'DB_USER', 'my-db-user' );
define( 'DB_PASSWORD', 'my-db-pwd' );
define( 'DB_HOST', 'localhost' );
WordPress 设置
Settings->
WordPress Address (URL) - New-URL
Site Address (URL) - New-URL
.htacess.php
Generate the .htacess from Permalink Settings
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /folder-name/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /folder-name/index.php [L]
</IfModule>
结束词
数据库查询
Updated tables wp_options , wp_posts , wp_usermeta, wp_links , wp_comments
Example:
UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL');
在此服务器上找不到请求的 URL /New-URL/folder-name/page-name 新 URL 端口 80 处的 Apache/2.4.7 (Ubuntu) 服务器
【问题讨论】:
-
您是否查看了永久链接设置以刷新永久链接缓存? typerocket.com/flushing-permalinks-in-wordpress
-
是的,我确实刷新了永久链接设置,但仍然面临同样的问题