【问题标题】:Run a wordpress site from one computer to another in localhost在 localhost 中从一台计算机到另一台计算机运行 wordpress 站点
【发布时间】:2020-04-09 14:18:52
【问题描述】:

我的一台计算机上有一个 Wordpress 网站。现在我想在本地的另一台计算机上运行该站点(xampp 或 wamp)。 为此,我使用数据库 SQL 文件压缩了该文件夹中的所有文件,并将该压缩文件解压缩到另一个 PC xampp htdocs 文件夹中。创建DB并导入数据库中的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' );

但还是一样的错误。

有人帮忙吗?提前致谢

【问题讨论】:

    标签: php wordpress xampp wamp


    【解决方案1】:

    我已经找到了解决方案。 在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>
    

    【讨论】:

      【解决方案2】:

      如果您想以更清洁、更快的方式完成所有操作,请安装 All in one Migration
      https://wordpress.org/plugins/all-in-one-wp-migration/

      【讨论】:

        猜你喜欢
        • 2021-07-18
        • 2015-02-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-01-03
        • 1970-01-01
        • 2016-04-16
        • 1970-01-01
        相关资源
        最近更新 更多