1. Open httpd-vhosts.conf (/opt/bitnami/apps/wordpress/conf/httpd-vhosts.conf) , it should look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<VirtualHost *:80> ServerName devis.cool ServerAlias www.devis.cool DocumentRoot "/opt/bitnami/apps/wordpress/htdocs" Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf" </VirtualHost> <VirtualHost *:443> ServerName wordpress.example.com ServerAlias www.wordpress.example.com DocumentRoot "/opt/bitnami/apps/wordpress/htdocs" SSLEngine on SSLCertificateFile "/opt/bitnami/apps/wordpress/conf/certs/server.crt" SSLCertificateKeyFile "/opt/bitnami/apps/wordpress/conf/certs/server.key" Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf" </VirtualHost> |
2. Add the HTTP to HTTPS redirect rule and configure VirtualHost for SSL Port (443), it should look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<VirtualHost *:80> ServerName devis.cool ServerAlias www.devis.cool DocumentRoot "/opt/bitnami/apps/wordpress/htdocs" RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L] Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf" </VirtualHost> <VirtualHost *:443> ServerName devis.cool ServerAlias www.devis.cool DocumentRoot "/opt/bitnami/apps/wordpress/htdocs" SSLEngine on SSLCertificateFile "/opt/bitnami/apps/wordpress/conf/certs/server.pem" SSLCertificateKeyFile "/opt/bitnami/apps/wordpress/conf/certs/server.key" Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf" </VirtualHost> |
3. Modify site url in wp-config.php (/opt/bitnami/apps/wordpress/htdocs/wp-config.php) from http to https:
1 2 |
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/'); define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/'); |