When setting up either a WordPress website or any other Bitnami installation on AWS, we commonly run into an issue. The issue is, your domain will be working normally with https:// or SSL. But your static IP address will also be working. This is a huge concern.
This was a huge concern atleast for me as both IP and domain of my website was indexed by Google.
Let’s see how to fix it. Throughout this article, we will refer to the official Bitnami Docs. The only issue with this doc is, it is a little counter intuitive.
1. SSH into your WordPress Bitnami Instance
click on the console button next to your instance in AWS.
2. Sudo Nano .conf
Open the main .conf file by using sudo nano command
sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf
3. Edit Code
Edit the .conf file as shown in the image. You have to edit it in 2 places.
this and the below image
As you can see, you have to edit it in 2 places. One in VirtualHost Port 80 and another in 443. Since you have to paste the code in the middle, it is not straightforward.
4. Restart Apache
Restart Apache Server of Bitnami by using the command
sudo /opt/bitnami/ctlscript.sh restart apache
Hope this helps! Thank you.