Arda Basoglu
  • Home
  • Blog
  • Links
  • Contact

Bitnami AWS Wordpress: Applying HTTPS and WWW Redirection Configuration

9/29/2017

2 Comments

 
Picture
If you have Bitnami WordPress for AWS Cloud with a load balancer and you installed your SSL certificate, there is some configuration you have to make so that your site can operate properly.

By applying these settings mentioned here, you will manage to redirect non www calls to www calls and redirect HTTP traffic  to HTTPS on your load balancer.

I'm assuming that you have access to your WordPress installation folder via FTP.

Here are the steps:
  • Go to  /opt/bitnami/apps/wordpress/conf folder.
  • Find the httpd-prefix.conf file and download it.
  • Add the below text at the end of that file and save the file.

        #################################################################################
        # redirect from non www to www
        # https://stackoverflow.com/questions/1100343/apache-redirect-from-non-www-to-www
        #################################################################################
        RewriteEngine On
        RewriteCond %{HTTP_HOST} !^www\. [NC]
        RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

       #################################################################################
       # How do I redirect HTTP traffic on my server to HTTPS on my load balancer?
       # https://aws.amazon.com/premiumsupport/knowledge-center/redirect-http-https-elb/
       #################################################################################
       RewriteEngine On
       RewriteCond %{HTTP:X-Forwarded-Proto} =http
       RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]

  • Upload your edited file back into /opt/bitnami/apps/wordpress/conf folder.
  • Restart Apache server by issuing the "sudo  /opt/bitnami/ctlscript.sh restart apache" command using your SSH connection.
Note: I left the code comments with the links in order for you to investigate further if something goes wrong.

I hope this helps someone out there :)

2 Comments

    Author

    Arda Basoglu is a digital marketing agency owner, software engineer/developer, musician. Worked for several companies: TWB, BNB Software, PINC Solutions,  hakia, Nurol,  NTV. 

    Archives

    October 2021
    August 2021
    June 2020
    April 2020
    September 2017
    July 2017
    April 2017
    February 2017
    September 2015
    October 2014
    March 2014
    February 2014
    January 2013
    June 2012
    May 2012
    July 2011
    December 2010
    November 2010
    October 2010
    August 2010
    July 2010
    June 2010
    March 2010
    February 2010
    January 2010
    December 2009
    November 2009
    October 2009
    August 2009
    June 2009
    May 2009

    Categories

    All
    Açık Kaynak
    Algorithms
    Avşa
    Big O Notation
    Certbot
    Database
    Ekmek
    Ekonomi
    Encrypting Settings
    Enflasyon
    Google Maps
    Heroku
    Heroku Rake Fixture Yaml Error
    JavaScript
    Mac Os X
    Magento
    .net
    .net Forms Login Progress Bar
    Node
    Node.js
    Node-postgres
    Personal
    Peynir
    Postgresql
    Rack 1.2.1 Utils.rb Error Heroku
    Ruby On Rails
    Windows 7
    Windows Froms
    Windsurfing
    Wordpress
    Yankoltuk

    RSS Feed

Powered by Create your own unique website with customizable templates.