HTTPSRedirect String Comparison does not match

My understanding of print() vs println() is that the latter will print the string on the next line. I haven't used println() in the comparison, so what is missing?

print() prints just the data.
println() prints the data and then a carriage return and a line feed. It does not print the data on the next line.

I posted the section of code that I changed, what is wrong with this?

The context is missing. In the last code you posted, you still have two variables named str. This has been pointed out to be a potential problem.

Printing the contents of one str, and using the other in the comparison, and finding that they are not equal, and then printing "Well, shit, they don't match" doesn't get you anywhere.

Compare this:

String alpha = "Alpha dog eats first";

// Some stuff

String alpha = "The puny dog eats last";

// Some more stuff

String whatIsWanted = "Alpha dog eats first";

if(alpha == whatIsWanted)
{
}
else
{
   Serial.println("They don't match");
}

to this:

String alpha = "Alpha dog eats first";

// Some stuff

String alpha = "The puny dog eats last";

// Some more stuff

String whatIsWanted = "Alpha dog eats first";

if(alpha == whatIsWanted)
{
}
else
{
   Serial.println("[");
   Serial.print(alpha);
   Serial.print("] does not match [");
   Serial.print(whatIsWanted);
   Serial.println("]");
}

If you see "They don't match", can you figure out why? If you see "[The puny dog eats last] doesn't match [Alpha dog eats first]", are you more, or less, likely to go "Oh, shit, I see the problem..."?