douxian6086 2019-06-20 13:35
浏览 124

Wordpress从一台服务器迁移到另一台服务器(未找到页面)

When I migrated the WordPress site from one server to another. Pages are not found, the error is coming while accessing the pages. I have updated the wp-config, .htaccess files and also changed the links and URL with the new site URL in the tables.

I have followed the below steps:

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 Setting

    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>

END Word

Database queries

    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');

The requested URL /New-URL/folder-name/page-name was not found on this server Apache/2.4.7 (Ubuntu) Server at New-URL Port 80

  • 写回答

1条回答 默认 最新

  • ds342222 2019-06-21 09:14
    关注

    If permalinks are refreshed and you updated the database also, you probably have htaccess problems.

    .htaccess should be spelled with double c, and should not have .php extension. You also have to update the folder-name inside to the actual folder you are using.

    .htaccess file:

    # 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>
    # END WordPress
    

    Also check out this .htaccess file: https://wordpress.org/support/article/giving-wordpress-its-own-directory/#method-i-without-url-change

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图