RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I don't understand what !=on means and what REQUEST_URI is.
In that notation != means NOT EQUAL. That is a combination of comparison =(equal) and boolean operation ! (negate or NOT).
So if rewrite is enable and request does not use HTTPS then replace the request by
https:// (original hostname) / (universal resouce identificator) Here URI is the string after the first slash after the hostname. It may include the path in the FS to the static file or some virtual path to the script including parameters passed by GET.
[R=code] means that rewriting rule causes the redirection with HTTP code 301 (= "moved permanently") Refer to the official mod_rewrite documentation for further reading: httpd.apache.org/docs/current/mod/mod_rewrite.html R flag, the server would just attempt to continue processing the modified request URL. In other types of URL modifications this might be possible, but in this particular case the modification calls for switching to the HTTPS protocol, so a redirect is necessary here. R flag was omitted, it would still result in an external (302) redirect. (If you specify an absolute URL as the RewriteRule substitution then Apache will implicitly trigger an external redirect, regardless of whether the R flag is explicity used.) It is the L (last) flag that prevents the continued processing of the URL (in the current pass at least).