zeldor.biz

Linux, programming and more

Copyright © 2023
Log in

Apache2 Redirect HTTP to HTTPS

February 14, 2011 by Igor Drobot Leave a Comment

Redirect

Apache’s mod_rewrite makes it easy to redirect normal pages to HTTPS. Because users often forget to type in the https. HTTPS very important for mail web access like squirrelmail or roundcube, to prevent clear text transmission of your passwords and messages


Edit your yirtual host and put this rewrite rules in it:

The easy one solution:

1
Redirect permanent / https://mx.idrobot.net/

Redirect permanent / https://mx.idrobot.net/

Another solution:

1
2
3
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

Filed Under: Linux, Networking Tagged With: Apache2. HTTP to HTTPS, HTTP redirect

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *