2017-08-07 18:42 GMT+03:00 Philippe Busque <[email protected]>:
> I have a configuration question regarding RewriteRule.
> We have a SSL terminator in front of our Apache, which redirect traffic to
> different port based virtual host depending on which protocol the connection
> came from.
> As a result, Apache is only responding to HTTP requests.
> We have RewriteRule that perform relative 301 and 302 redirections.
> Exemple: RewriteRule ^/deprecatedPage.html$ / [R=301,L,E=nocache:1]
> According to the documentations:
> "If a fully-qualified URL is specified (that is, including
>http://servername/) then a redirect will be issued to that location.
> Otherwise, the *current protocol*, servername, and port number will be used
> to generate the URL sent with the redirect. "
> Because of the current protocol clause, all URL that are sent to a https
> address are redirected back to http. We have a catch all http to https
> redirection too, but that cause two redirections in a row we would like to
> Other than inputing the absolute URL to the destination, is it possible to
> change the 'current protocol' so that mod_rewrite put https rather than
> I tried SetEnv SERVER_PROTOCOL=https without success.
It sounds similar to the question that I answered in January: