- installed Apache 2.2 with OpenSSL module bundled
- installed OpenSSL - http://slproweb.com/products/Win32OpenSSL.html
- start Windows Command Prompt as Administrator
- go to C:\OpenSSL\bin(or the folder where you installed OpenSSL)
- follow the steps from 1 to 4 - http://www.akadia.com/services/ssh_test_certificate.html
- copy the server.key & server.crt to <Apache2.2>/conf/ssl
- open the httpd.conf and add
Listen 443
- enable mod_ssl in httpd.conf
- at end of httpd.conf add this
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLSessionCache none
</IfModule>
<VirtualHost *:80>
DocumentRoot "path-to-public-folder"
ServerName yourapp.example.com
ServerAlias *.yourapp.example.com
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "path-to-public-folder"
ServerName yourapp.example.com
SSLEngine On
SSLCertificateFile conf/ssl/server.crt
SSLCertificateKeyFile conf/ssl/server.key
</VirtualHost>
.htaccess for Laravel 4+
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect to HTTPS...
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Open http://yourapp.example.com and you will be redirected to https://yourapp.example.com