In case anyone is trying to doa similar thing, here is the code I
ended up with to redirect a specific https request to http:

In the Active4D.a4l library On Request handler:

method "On Request"($inURL; $inQuery)
        if (get request info("*secure") = "1")
                if (get request info("*host") = "testdb6.domain.org")
                        $url := "http://"; + get request info("*host")
                        //set response status (302)
                        set response header ("Location"; $url)
                else
                        return
                end if
        else
                return
        end if
        
end method

A few small tweaks:

method "On Request"($inURL; $inQuery)
        if (request info{"*secure"} = "1")
                if (request info{"*host"} = "testdb6.domain.org")
                        $url := "http://"; + request info{"*host"}
                        //set response status (302)
                        response headers{"Location"} := $url
                end if
        end if
        
end method

Regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to