Rodolfo Bandeira
← Archive
Article

How to redirect all http to https in your Apache

· 1 min read


How to redirect all http to https in your Apache?

Just edit your httpd.conf in the VirtualHost section and put this code:

<VirtualHost *:80>
    ServerAdmin YOUR_EMAIL_ADMIN_HERE
    DocumentRoot /var/www
    ServerName YOUR_SERVER_DOMAIN_HERE
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

Rodolfo