Use gsub instead of destructive gsub!

All urls would have the same (last) subdomain if the
`secure_distribution` string is edited in place.