<< All Posts
How to redirect all http to https in your Apache


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



<< All Posts

rodolfo.io

🇧🇷 🇨🇦
Runs on OpenBSD 🐡