正常运行的wordpress站点地址移动到相同的域名和服务器上,但现在没有显示出来


Functioning wordpress site address moved on same domain and server per WP directions but not now showing up

GoDaddy上的Co-Hosting,已经在主域名下的子文件夹下设置了一个功能齐全的WordPress站点,从"/WordPress/"重命名为"/opportunities/" => " http://howtoliveoffthegridnow.com]/opportunities/"自然,这就像它应该的那样完美地工作!

按照WP的说明移动"站点地址(URL)",同时保留"WordPress地址(URL)",我复制了"the"。从"WordPress地址(URL)"中获取"htaccess"answers"index.php"文件。"/opportunities/"文件夹,如上所述,放到新指定的文件夹"shopping"中,这样"站点地址(URL)"就变成了"http://shopping.howtoliveoffthegridnow.com/",这就像它应该的那样工作,并且与上面的原始设置一样好!

在文件夹的情况下,主要基于php的网页内容(不是WP内容)标记为"howtoliveoffthegridnow.com",这是位于我们版本的GoDaddy"public_html"主文件夹下。我们的"/opportunities/"文件夹是位于"howtoliveoffthegridnow.com"下的子文件夹。我们的新"购物"文件夹直接在GoDaddy的"public_html"主文件夹下。网站DNS记录已更新,以包含此"购物"子域名的"A"托管记录。

。文件现在复制到"Shopping"文件夹,按照WP的说明,如下所示:

    `# BEGIN WordPress`
    `# From wordpress itself after changing site address`
    `<IfModule mod_rewrite.c>`
    `RewriteEngine On`
    `RewriteBase /`
    `RewriteRule ^index'.php$ - [L]`
    `RewriteCond %{REQUEST_FILENAME} !-f`
    `RewriteCond %{REQUEST_FILENAME} !-d`
    `RewriteRule . /index.php [L]'
    `</IfModule>'
    `# END WordPress`

根据WP的说明,"index.php"文件的内容现在复制到"Shopping"文件夹中,如下所示:

`<?php'
`/**'
` * Front to the WordPress application. This file doesn't do`
`   anything, but loads
` * wp-blog-header.php which does and tells WordPress to load the theme.`
` *`
` * @package WordPress`
` */`
`/**`
` * Tells WordPress to load the WordPress theme and output it.`
` *`
` * @var bool'
` */`
` // remove 'shopping' subdomain name from directory path`
`$dir_root = str_ireplace('/shopping', '', dirname(__FILE__)); `
`/wp-blog-header.php'." <br />";`
`define('WP_USE_THEMES', true);`
`/** Loads the WordPress Environment and Template */'
`//require( dirname( __FILE__ ) . '/howtoliveoffthegridnow.com/opportunities/wp-blog-header.php' );'
`require( $dir_root . '/howtoliveoffthegridnow.com/opportunities/wp-blog-header.php' );'

将这两个文件设置在"shopping"文件夹中,"http://howtoliveoffthegridnow.com/opportunities/"中原始WordPress安装的内容完美地显示在"http://shopping.howtoliveoffthegridnow.com/"下,这也像它应该的那样完美地工作。

但是,当随后将"站点地址(URL)"的子域名从"购物"更改为"交易"时,通过在相同的站点public_html主文件夹下创建一个名为"交易"的新文件夹,并按照上述域名和服务器设置分别为"购物"answers"/opportunities/"复制所需内容。现在,当选择"http://deals.howtoliveoffthegridnow.com/"而不是"http://shopping.howtoliveoffthegridnow.com/"时,"交易"网站只显示一个页面,除了默认的"即将到来"主题/空白页面,而不是WordPress内容,完美地显示在"购物"或"/机会/"分别当"网站地址(URL)"数据相应地分别更改为适合所需的输出URL。

站点DNS记录也已更新,以包含此"deals"子域名的"A"托管记录。

还注意:"deals"文件夹的"index.php"文件被编辑为:

` // remove 'shopping' subdomain name from directory path`
`$dir_root = str_ireplace('/shopping', '', dirname(__FILE__)); `

:

` // remove 'deals' subdomain name from directory path`
`$dir_root = str_ireplace('/deals', '', dirname(__FILE__)); `

如有任何建议,我将不胜感激。

注意:每个"http:"和上面的"//?? ?restoftheurl.com"之间的空白只是为了遵守限制帖子中可以包含的链接数量的限制,如果你选择尝试遵循任何这些链接,应该忽略这些空白。

根据您的问题,您正试图将WordPress站点从子文件夹移动(迁移)到子域(并且它不工作)。

我是这样做的:

在您的原始/工作(基于子文件夹)站点上,安装这个插件:

https://wordpress.org/plugins/duplicator/

接下来,生成一个Duplicator包(通过wp-admin仪表板上的插件菜单)。

生成包后,将两个包文件(installer.php和archive/zip文件)下载到PC上。接下来,将这两个文件上传到希望在其中创建站点的子域(deals)文件夹。接下来,在浏览器中打开以下链接:

http://deals.howtoliveoffthegridnow.com/installer.php

并按照屏幕上的说明操作。你的网站应该创建好了,一切都应该正常。

经过进一步调查,我很尴尬地承认——但我确实承认,这个问题似乎已经发生了,因为我在GoDaddy cPanel选项中将"deals"添加到我的文件结构时,无意中跳过了创建"deals"作为子域的关键步骤。

我没有从cPanel图标开始创建一个新的子域,而是直接转到DSN记录页面,手动创建了新记录,绕过了将子域文件夹正确连接到web层次结构的底层代码,因此,尽管人们可以通过在浏览器中输入其URL来拉起子域,但该结果实际上是与其相关的主域孤立的。

重新执行了我的步骤并正确地添加了这个sub=域,问题现在已经解决了

这里的教训似乎是我们不能跳过步骤,因为当底层系统被绕过时,这会使我们在达到目标的努力中失败。