Anyone with a tricked out .htaccess file
Been using this one for years, works great:

&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

    # ========================================= #
    # Force website to use "www"
    RewriteCond %{HTTP_HOST} ^example.com [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
    # ========================================= #

    # ========================================= #
    # Force website to use "https"
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
    # ========================================= #

    # ========================================= #
    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
    # ========================================= #

&lt;/IfModule&gt;


This one adds www, but it's simple to reverse that (as you do in your original example).