Forum Moderators: phranque
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://www.example.com%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
....whereas I'm hosted on Apache 1.3
RewriteRule (.*) https://www.example.com%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^ https://www.example.com%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^(example\.com)?$
RewriteRule (.*) https://example.com/$1 [R=301,L]
The second condition can perfectly well be expressed as RedirectPermanent / https://example.com/
The use of RewriteRule to perform this task may be appropriate if there are other RewriteRule directives in the same scope. This is because, when there are Redirect and RewriteRule directives in the same scope, the RewriteRule directives will run first, regardless of the order of appearance in the configuration file.
So anyone still using 1.3 is now seventeen years out of date.
almost 10 years agoYes, I saw that one too, but figured the key point is that there are three newer whole-number* versions, starting with the one released 17 years ago. Do there exist servers so (physically) ancient, they would melt if you tried to install anything newer than Apache 1.3 on them?