WordPress Website is running in 2 diffrent versions, one With WWW Prefix, One Without WWW Prefix on AWS (EC2) after Lets Encrypt SSL Installation

0

I have recently installed WordPress Certified by Bitnami Application on AWS EC2, I found out the website was loading in 2 diffrent version on with www. one without www.

I found this code after some research and it worked for me (WWW. Prefix)

/opt/bitnami/apache2/conf/bitnami/bitnami.conf

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Later I installed letsencrypt SSL on my site, after installing ssl i am facing the same trouble

In order to force load ssl i had to enter below code in same file

RewriteEngine On
 RewriteCond %{HTTPS} !=on
 RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
 RewriteRule ^/(.*) https/www.xyz.com/$1 [R,L]

Please Help, I

Hi @naffysmir

please answer the following questions. That’s the standard template of #help


Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):


Currently, I don’t understand your question.

1 Like

Hi @naffysmir,

Welcome to the community forum. Since you’re running the Bitnami stack, you could use the bncert-tool provided by Bitnami. Docs can be found at https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/#use-the-bitnami-https-configuration-tool . This should prevent you from having to deal with Apache configurations, not that that’s a bad thing.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.