All pastes #2092589 Raw Edit

Something

public text v1 · immutable
#2092589 ·published 2011-10-22 18:12 UTC
rendered paste body
<LuaHookTranslateName redirect_ssl>
require "apache2"
function redirect_ssl(r)
    if r.subprocess_env['SSL'] == nil then
      r.err_headers_out['Location'] = string.gsub(r:construct_url(r.uri), "http://", "https://")
      return 302
    end
    return apache2.DECLINED
end
</LuaHookTranslateName>