Kompx.com or Compmiscellanea.com

HTTP to HTTPS redirect in .htaccess

Web servers : Apache + nginx

Redirecting from all domain names of a web site to its web address with HTTPS and the domain with www. The names to be redirected from are:

  • Both with and without www - URL with HTTP
  • Without www - URL with HTTPS

Server configuration: Apache + nginx. SSL is enabled. SSL-certificate is purchased, approved and installed. That is, everything is up and running. So it is just the HTTP to HTTPS redirection that is left to get ready and start up. Directives for .htaccess file:

RewriteEngine On

RewriteCond %{HTTP:HTTPS} !on [NV]

RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L]

RewriteCond %{HTTP_HOST} !^www\.

RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L]

HTTP to HTTPS redirect in detail

-- Enable runtime rewriting engine:

RewriteEngine On

-- If HTTPS is not present:

RewriteCond %{HTTP:HTTPS} !on [NV]

-- Then replace HTTP + domain (with or without www) with HTTPS + domain with www:

RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L]

-- If HTTPS is present, but domain name has no www (the case when https://domain.tld is entered in address bar):

RewriteCond %{HTTP_HOST} !^www\.

-- Then replace it with HTTPS + domain with www:

RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L]

Notes

  • RewriteCond %{HTTP:HTTPS} !on [NV] is not the only way to detect if HTTPS is not present. Moreover, for some server configurations other directives may be more suitable, like RewriteCond %{SERVER_PORT} !443 for example. The point is to find out somehow if HTTPS is not on. So it should probably be checked by practice what is going to work in a particular case.
  • Apache Module mod_rewrite docs: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

Aliosque subditos et thema

 

Windows console applications

 

Some time ago text-based applications were the only form of software of average end user computer experience. As well as after the graphical user interface programs started to become widespread, console applications used to retain their strong positions. But gradually GUI software virtually superseded text-based applications in daily use of the average end user. However, even now there are console programs that can more or less compete with software of graphical user interface, be useful for the average user to solve various problems and fulfill numerous tasks on modern computers. Windows console applications. File managers Windows console applications. Multimedia Windows console applications. Web browsers Windows console applications. Text editors Besides file managers, multimedia programs, text editors, web browsers, there are plenty of other text-based programs and utilities for use under Windows: both standalone and those included in MS Windows distributions. For example, ipconfig and netstat for work with network, Windows built-in FTP client useful for some tasks, CommandBurner for command line burning CD / DVD or cdburn with dvdburn from Windows Server 2003 Support Tools for the same, etc.

Renaming files in mc

 

Renaming a file in mc / Midnight Commander: - Select a file --> Shift - F6 --> Edit existing file name into a new one --> Enter Select a file Edit file name The original way of renaming a file - the one mc / Midnight Commander had before "Shift - F6" was implemented - is also still there: - Select a file --> F6 --> Enter a new file name --> Enter Select a file Enter file name And "Esc - 6" may be used instead of "F6": - Select a file --> Esc - 6 --> Enter a new file name --> Enter Select a file Enter file name