Press "Enter" to skip to content

Apache SSL Redirect

Need to redirect all traffic to an Apache server from HTTP (Port 80) to HTTPS (port 443)?

Just add a redirect statement in your httpd.conf for that server.

<VirtualHost *:80>
DocumentRoot "/path/to/"
ErrorLog logs/greyfuzz-error.log
CustomLog logs/greyfuzz-access_log combined
Redirect /
<Directory "/path/to/">
Your directory options

Line #7 above does the magic for you.

Be sure to include the trailing ‘/’ on the end of the domain being redirected,
without it you may get some untoward URLs that look like
https://www.greyfuzz.comindex.php instead of

Note: Be certain your conf.d/ssl.conf (or equivalent) is already set up and HTTPS is working properly first.