Tag Archive for: connection

Forcing the domain to serve securely using HTTPS (for any site)

Is your WordPress site shown as No Secure Connection? Solve this easily forcing any http request to be rewritten using https. Just copy and paste the code below into your .htaccess file exactly as shown.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Header always set Content-Security-Policy: upgrade-insecure-requests

Prevent SSH from disconnecting

If you are working with your server, ex: sending some file now and then with SSH, you can experience some annoying connection losses. Actually, if SSH has been idle for a while the connection will be closed.

You can prevent this easily adding a config file with just 2 lines of code to your .ssh folder in your home.

nano ~/.ssh/config
Host *
    ServerAliveInterval 30

Note: in Ubuntu TCPKeepAlive is active by default.