Home » Blog » Redirect Static IP to Domain in Bitnami AWS Lightsail

Redirect Static IP to Domain in Bitnami AWS Lightsail

  • by
Bitnami

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

Sudo nano - bitnami.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.

bitnami edit ip to domain 1

this and the below image

bitnami ip to domain 2

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.

Leave a Reply

Your email address will not be published. Required fields are marked *