HTTP to HTTPS Location rewrite with custom port
Problem this snippet solves: The SSL port is assigned in the following line:
lreplace $loc_list 2 2 [lindex [split [lindex $loc_list 2] ":"] 0]:80
change the ':80' to any required port...
Updated Jun 06, 2023
Version 2.0Andy_McGrath
Cumulonimbus
Joined November 14, 2005
Stanislas_Piro2
Dec 15, 2017Cumulonimbus
lreplace command doesn't replace any value in list but returns a new list with replaced value.
you can use this command :
set loc_list [lreplace $loc_list 0 2 https {} [lindex [split [lindex $loc_list 2] ":"] 0]:80]
or
set loc_list [lreplace $loc_list 0 2 https {} [getfield [lindex $loc_list 2] ":" 0]:80]