Http to Https redirection not working in Bitnami Wordpress Multisite on AWS Lightsail

Keywords: WordPress - AWS - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: ff0377f9-3ed2-6ec1-3cea-47948774d61d
Description:
When I try to visit my website by typing the http url, I am not being redirected to https. Following are the steps I followed while setting up my instance

  1. Created fresh instance using AWS Lightsail with Bitnami Wordpress Multisite Image
  2. Ran bncert-tool to setup ssl for all the domains together. The primary site was specified as the first domain in the domain list
  3. Configured the primary domain for wordpress using sudo /opt/bitnami/configure_app_domain --domain
  4. Updated the bitnami.conf so it looks like this
# Default Virtual Host configuration.

# Let Apache know we're behind a SSL reverse proxy
SetEnvIf X-Forwarded-Proto https HTTPS=on

<VirtualHost _default_:80>
  DocumentRoot "/opt/bitnami/apache/htdocs"
  #Force HTTPS redirect
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
  # BEGIN: Configuration for letsencrypt
  Include "/opt/bitnami/apps/letsencrypt/conf/httpd-prefix.conf"
  # END: Configuration for letsencrypt
  <Directory "/opt/bitnami/apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>

  # Error Documents
  ErrorDocument 503 /503.html
</VirtualHost>

Include "/opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf"
  1. Restarted apache

However, if I go to any of my sites using http, it does not redirect to https. I have run the bitnami support tool and the log number is ff0377f9-3ed2-6ec1-3cea-47948774d61d

Any help is greatly appreciated! Thank you!

Hello @mailalokagrawal,

Thanks for using or Wordpress solution! Please check our Force HTTPS Redirection With Apache and add the RewriteRule to the -vhosts.conf files as explained there. Apart from that, please try using the ServerName and ServerAlias directives as explained in Configure Blogs For Different Domains With Different SSL Certificates:

    ServerName yourserverdomain.com
    ServerAlias *.yourserverdomain.com

Regards,
Francisco de Paz

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