在本地主机中从一台计算机运行wordpress站点到另一台计算机



我的一台电脑上有一个Wordpress网站。现在我想在本地另一台计算机(xampp 或 wamp(上运行该站点。 为此,我使用数据库SQL文件压缩了该文件夹中的所有文件,并将该压缩文件提取到另一个PC xampp htdocs文件夹中。创建数据库并将 SQL 文件导入到数据库中。

但是在运行站点时,它会给出错误

未找到 在此服务器上找不到请求的 URL/Ullash/builders/index.php。

我在wp-config.php中添加了以下代码

define( 'WP_HOME', 'http://localhost/Projects/new-ullash/builders' );
define( 'WP_SITEURL', 'http://localhost/Projects/new-ullash/builders' );

但错误仍然相同。

有人帮忙吗?提前致谢

我已经找到了解决方案。 在wp-config.php中添加以下代码

define( 'WP_HOME', 'site url' ); // site url sample : http://localhost/Projects/new-ullash/builders
define( 'WP_SITEURL', 'site url' ); // site url sample : http://localhost/Projects/new-ullash/builders

并更改.htaccess文件中的项目路径

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Projects/new-ullash/builders/  // change project path here
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /Projects/new-ullash/builders/index.php [L] // change project path here
</IfModule>

如果您想以更干净,更快的方式完成所有操作,请安装多合一迁移
https://wordpress.org/plugins/all-in-one-wp-migration/

最新更新