Page 1 of 1

Check if the page called from HTTP or HTTPS

PostPosted: Fri Jul 29, 2022 7:54 pm
by Otto
Dear Antonio,
Can we check if a call is from http or https?
Best regards,
Otto

I need

TEMPLATE
<script>
document.write(document.location)
</script>
ENDTEXT

but in mod harbour.

So I thought to take AP_HeadersIN() Host-key and AP_FileName() and STRTAN() to change \/ and drive APACHE dir C:/www/htdocs to https://domain and rest from AP_filename()

Re: Check if the page called from HTTP or HTTPS

PostPosted: Sat Jul 30, 2022 2:22 am
by Antonio Linares
Dear Otto,

Please try checking AP_GetEnv( "HTTPS" )

best regards

Re: Check if the page called from HTTP or HTTPS

PostPosted: Sat Jul 30, 2022 7:20 am
by Otto
Dear Antonio, perfect!
Best regards,
Otto