I tried adding this on the .htaccess file on the root of lamp server ( on Amazon EC2 Ubuntu Instance )
<VirtualHost *:80>
...
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}
...
</VirtualHost>
And ended up with this error
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
xx.x.xxx.xxx Apache/2.4.10 (Unix) OpenSSL/1.0.1i PHP/5.5.15 mod_perl/2.0.8-dev Perl/v5.16.3
Also tried finding /etc/apache2/mods-enabled directory to write a rewrite configuration, but there is no such directory on Ubuntu 14.04
Someone knows who to enable the rewrite module?