PHP – replace http with https in URL Posted on December 3, 2021 By christo No Comments on PHP – replace http with https in URL Simple PHP script to replace http into https Here is the top answer to replace http into https <?php $url = preg_replace("/^http:/i", "https:", $url); ?> php Tags:php