Restore original URL scheme after str_replace to avoid insecure content issues