anchor.diff:                                             false ->
                                                  "http"
                                          end,
  -                    {handled, redirect(ProtocolAsString, Hostname, ReqData)};
  +                    {handled, redirect(true, ProtocolAsString, Hostname, ReqData)};
                   no_host_match ->
                       {{no_dispatch_match, undefined, undefined}, ReqData}
               end,
  
positive.code:         {ok, Remainder, NewBindings, Depth} ->
              case {proplists:get_value(ssl, Props), IsSSL} of
                  {undefined, true} ->
                      Port = z_config:get(listen_port),
                      %Host1 = set_port(Port, HostAsString),
                      {Host1, _Port} = split_host(HostAsString),
                      {redirect, "http", Host1};
                  {false, true} ->
                      Port = z_config:get(listen_port),
                      %Host1 = set_port(Port, HostAsString),
                      {Host1, _Port} = split_host(HostAsString),
                      {redirect, "http", Host1};            
                  {true, false} ->
                      Port = z_config:get(listen_port_ssl),
                      %Host1 = set_port(Port, HostAsString),
                      {Host1, _Port} = split_host(HostAsString),
                      {redirect, "https", Host1};
  
negative.code: 
  
  %% @doc Redirect to another host name.
  redirect(IsPermanent, ProtocolAsString, Hostname, ReqData) ->
      RawPath = wrq:raw_path(ReqData),
      Uri = ProtocolAsString ++ "://" ++ Hostname ++ RawPath,
      RD1 = wrq:set_resp_header("Location", Uri, ReqData),
      {ok, RD2} = webmachine_request:send_response(case IsPermanent of true -> 301; false -> 302 end, RD1),
      LogData = webmachine_request:log_data(RD2),
      LogModule = 
          case application:get_env(webmachine,webmachine_logger_module) of
  