简体   繁体   English

手动将 WordPress 数据库从域转移到另一个域,在固定链接中使用 postname

[英]Manually transfer WordPress database from domain to another domain with postname in permalink

I'm new to WordPress.我是 WordPress 的新手。 I needed to transfer a WordPress site from domain to another domain.我需要将 WordPress 网站从域转移到另一个域。 In addition, the previous WordPress site was in trouble.另外,之前的 WordPress 网站出了问题。 So I did not have access to the dashboard.所以我无法访问仪表板。 So, I decided to install a new WordPress in new host and domain then transfer Data Base.所以,我决定在新的主机和域中安装一个新的 WordPress,然后转移数据库。 But I forgot to get Premlink out of postname.但是我忘了从 postname 中取出 Premlink。 WordPress pages are not displayed right after import and I have 404 error.导入后没有立即显示 WordPress 页面,并且出现 404 错误。 please guide me.请指导我。 This is very important to me.这对我来说非常重要。

This is actually a very common issue.这其实是一个非常普遍的问题。 The steps you should take is in the following order:您应该采取的步骤如下:

  1. Be sure your server honors the .htaccess file ( /etc/apache2/sites-available/your-domain-probably.conf There should be something like确保您的服务器尊重 .htaccess 文件( /etc/apache2/sites-available/your-domain-probably.conf 应该有类似

    <Directory /var/www/your/path> AllowOverride All </Directory>
  2. Go to your /wp-admin -> settings -> permalinks select your type and then click save even if your type is already selected转到您的 /wp-admin -> 设置 -> 永久链接选择您的类型,然后即使您的类型已被选择,也单击保存

  3. If the steps above be sure that your web server has privileges to write in your wordpress installation directory.如果以上步骤确定你的web服务器有权限写入你的wordpress安装目录。 Assuming you use apache2 up until now that would be假设您到目前为止使用 apache2 那将是

    sudo chown -R www-data:www-data /var/www/your/wordpress/directory sudo chmod -R 755 /var/www/your/wordpress/directory

    Hope i was helpfull !希望我有帮助!

In the database, you probably need to update the site url and the home url.在数据库中,您可能需要更新站点 url 和主页 url。 You also need to move the wp-content directory.您还需要移动 wp-content 目录。

The answer is here:答案在这里:

https://codex.wordpress.org/Changing_The_Site_URL https://codex.wordpress.org/Changing_The_Site_URL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM