Hi,
I am trying to configure my Wordpress through a Load Balancer via HTTPS, for this I am using the following configuration:
An EC2 instance of AWS - Bitnami Multisite (ami-99022cf9)
An AWS ACM certificate for my domain (here I have added all the additional names I need)
The records "mydomain.com" and "www.mydomain.com" as record A (alias of Route 53) to the Load Balancer address
My idea is to have some sites in this my Multisite, but not all can be HTTPS, so I read in several places that I can change the bitnami.conf
file in opt/bitnami/apache2/conf/bitnami
These instructions are here:
https://docs.bitnami.com/aws/components/apache/#how-to-force-https-for-all-applications
But in doing so, I had a problem, because all my sites have turned HTTPS and I can not leave it like this, only some must be HTTPS, others must remain HTTP.
So I tried this:
But in my case it did not work very well, because mine is a Multisite and then all my sites "redirected" to one.
So I tried this:
And it just worked!!!
All I expected was for the user to enter any address, enter through https://www.mydomain.com but upon entering my mydomain2.com for example continue HTTP and these instructions solved that.
The only problem I am now, unfortunately, is that I can not log into WP-Admin anymore, when I do this I'm in a loop.
In short, all Bitnami files are the same as when I started the instance for the first time, except for the file /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf
I added this:
RewriteEngine On
RewriteCond% {HTTP: X-Forwarded-Proto} = http
RewriteRule. Https: //% {HTTP: Host}% {REQUEST_URI} [L, R = permanent]
It seems that all that is missing is to add a condition in this code to accept my WP-Admin, but my limitations to this did not allow me to continue, please, anyone know what I should do?
Thanks and Best Regards