Apache HTTPS Redirect

There was a time a TLS certificate was quite expensive and most websites were only accessible unencrypted with HTTP. Nowadays basic domain validated TLS certificates are free and you have only to pay for “business certificates” with extended validation options. So there is no excuse for not supporting HTTPS any more!

Now lets benefit from better search engine rating (Google prefers TLS encrypted websites) and make the world more secure by redirecting all unencrypted HTTP to encrypted HTTPS traffic. Most servers like mine run the Apache HTTP Server which can do this very easy and very fast (compared to e.g. plugins for CMS). Create a file named .htaccess and place it in the root folder of your website (that’s where your top level index HTML file lives). The content of the file should look like this:

# Force HTTPS
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.domain\.tld [NC]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=permanent,L]

If the file already exists, you can add the snippet above at the top of the file. You have to change the placeholder for the domain name to your domain name and you should take care of where to escape (RewriteCond) and where not to escape (RewriteRule) the dots of your domain name.

Stay secure

JavaLand 2017

New Design

Welcome back! As you can see, my website has a new design. It should be clean and fresh and I hope my work was successful.

The last few months I investigated a lot of time and energy in projects like the Docker Switzerland User Group Meetup in Lucerne, the theses of my students at the TEKO and a lot of other stuff. Now I want to focus on my own projects like my conference talks and my open source projects again. The redesign of my website is only the beginning…

I hope to see you soon again