0

I am about to start building a new site in Wordpress on the same domain as the old site. I need the old site to stay live until the new one is launched and I also need to develop online.

What is the best way to go about this? Should I create a subdomain or subfolder?

How would I go about migrating the Wordpress site & database from this testing area to the root on completion?

Thanks.

4

3 回答 3

1

使用 WordPress,您可以创建像http://blog.mysitename.com这样的子域或像http://mysitename.com/blog/这样的子文件夹- 任一个 WordPress 都支持 - 您只需要进行设置在您的 wp_options 表中(通常是带有 ID 1 和 39 的行)指向您设置的相应域。它只是取决于您对服务器的控制类型,但从它的声音来看,您应该有足够的能力来做这两件事。

对于您的数据库 - 您实际上可以指向同一个数据库,只需在表名前加上某种前缀,以区分现有站点和新站点。默认情况下,WordPress 会在您的表名前面加上“ wp_”,例如“ wp_TABLE_NAME”,所有大写都被替换为 WordPress 表的实际名称(如您的 wp_options 表)。或者,您也可以建立一个全新的数据库,这并不重要。

关键是当 WordPress 站点准备好上线时,您需要将主域指向新站点,然后更改 wp_options 表以使用新 URL。

于 2009-11-24T19:36:08.803 回答
1

这取决于您的托管环境。

如果您有 Cpanel 托管帐户,则可以通过该帐户创建子域,这实际上会创建一个子文件夹。这称为虚拟子域。

因此,您可以通过访问 www.yourdomain.com/subfolder 或 www.subfolder.yourdomain.com 访问测试站点

这很好,因为它不会以任何一种方式锁定你。

至于迁移您的站点,我将在本地(通过 FTP)备份您的旧站点文件,并通过 PHPMYADMIN 备份您的数据库。然后通过 FTP 将您的开发站点复制到根目录并通过 PHPMYADMIN 更新您的数据库

于 2009-11-24T05:02:51.387 回答
0

您可能还需要更改 .htaccess,除非 Cpanel(如果使用)处理:更改站点 URL « WordPress Codex移动 WordPress « WordPress Codex

于 2009-11-24T15:01:41.493 回答