Make mod rewrite enabled in apache:
# ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/Edit /etc/apache2/sites-enabled/000-default
Add the following lines in <VirtualHost *:80> section:
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
Save the file and restart the apache web server.