Thanks for using Bitnami WordPress!
Thanks for the detailed explanation, it helps us a lot to understand the issue. I have tried replicating your scenario locally, using a new instance in AWS running WordPress 5.6
I have the following:
1) My instance is at INSTANCE-IP
2) I have added a new entry to my
/etc/hosts/ file, defining a DNS domain for INSTANCE-IP.
$ tail -n1 /etc/hosts
3) I have configured my instance's ServerName to be backend.coolsite.es:
$ cat /opt/bitnami/apache2/conf/httpd.conf | grep "ServerName "
# ServerName gives the name and port that the server uses to identify itself.
4) However, my WordPress is configured to use the apex URL:
$ cat /opt/bitnami/apps/wordpress/htdocs/wp-config.php
This means that any redirection to
back.coolsite.es would result in error, as my computer does not know how to resolve this address:
$ curl -I back.coolsite.es
curl: (6) Could not resolve host: back.coolsite.es
However, accessing using the apex domain works flawlessly (including the
$ curl -I coolsite.es/wp-login.php
HTTP/1.1 200 OK
Date: Thu, 07 Jan 2021 11:51:59 GMT
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Set-Cookie: wordpress_test_cookie=WP%20Cookie%20check; path=http:/coolsite.es/
Set-Cookie: wordpress_test_cookie=WP%20Cookie%20check; path=/
Cache-Control: max-age=0, no-cache
Content-Type: text/html; charset=UTF-8
I have the latter configured currently and I have tried the alternative but this then results in malformed URLs with duplicate apex domain names in the address.
I did not experience any issues or malformed URL, neither navigating through the website nor the dashboard (after logging in). I have been checking your configuration files and spotted a tiny error:
- #define('WP_HOME', 'https:/YOURDOMAIN.com/');
+ #define('WP_HOME', 'https://YOURDOMAIN.com/');
Beware that this may prevent you from logging in.
I might be wrong here, but maybe the erratic behaviour is introduced by the CloudFront configuration and not the instance itself.
Jose Antonio Carmona
Was my answer helpful? Click on