关于亚马逊网络服务:如何使用AWS Bitnami在WordPress上使用自定义子域

How to get custom subdomain working on WordPress with AWS Bitnami

我在AWS上安装了一个Bitnami / WordPress实例,通过公共IP都可以很好地工作,但是当我尝试设置子域时,我遇到了一些问题,我按照这里的说明进行操作:

https://docs.bitnami.com/bch/apps/wordpress/administration/configure-domain/

我将wp-config.php文件更新为https://blog.domain.com/(domain.com已替换为我的实际域),如指示所示。看起来像这样:

1
2
define('WP_SITEURL', 'https://blog.domain.com/');
define('WP_HOME', 'https://blog.domain.com/');

然后在我的DNS提供程序(CloudFlare)中,将blogA Record设置为public IP

但是,当我转到该网址时,会看到以下内容:

Bad WordPress

当我转到https://blog.domain.com/wp-admin时,我看到以下内容:

Redirect Issu

请注意,i'm not attempting to setup a Multisite environment我只希望在子域https://blog.domain.dom

上设置一个Wordpress实例


这实际上不是WordPress问题。您面临的问题是apache中域的路由-通常apache表示网站位于何处。 app/wordpress/htdocs/{website}(网站位于htdocs目录中)。您需要做的是更改httpd.conf以识别该子域,并且还需要添加一个子文件夹,该子文件夹将指向您的子域。

!重要!在bitnami堆栈中,.conf文件的位置不同:/opt/bitnami/apache2/conf/bitnami/bitnami.conf

我不确定您的文件夹结构是什么样子,但是可能是这样的:app/wordpress/htdocs/{main_website}以及对于子域app/wordpress/htdocs/blog/{blog_website}

因此在您的httpd.conf中:

1
2
3
4
5
6
7
8
9
10
11
12
13
<VirtualHost *:80>
    DocumentRoot"/opt/bitnami/apache2/htdocs/abc"

    ServerAdmin [email protected]

    ServerName abc.your_domain.com

    ServerAlias www.abc.your_domain.com

    ErrorLog"logs/abc-error_log"

    CustomLog"logs/abc-access_log" common
</VirtualHost>

来源:https://community.bitnami.com/t/sub-domain-pointing-to-a-sub-folder/11796

我希望这会有所帮助。