while loop not breaking

Hi everyone,
I wanted to control 4 relay through ethernet shield so I wrote some code but code did not work perfectly therefore I made some observation ;
for example when I start while loop ,while loop finish correctly at the end of time condition but When I want to break while loop I could not did and while loop did not break .
do you think what is the problem ?

#include <SPI.h> 
#include <Ethernet.h>

 byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};//physical mac address 
byte ip[] = { 192, 168, 1, 45 }; // IP address in LAN – need to change according to your Network address 
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router 
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask 
EthernetServer server(80); //server port

String readString;
int relayone=6;
int relaytwo=7;
int relaythree=8;
int relayfour=9;
unsigned long lasttime=0;
int interval_one=15000;
int interval_two=10000;

void setup(){

    pinMode(relayone,OUTPUT);
    pinMode(relaytwo,OUTPUT);
    pinMode(relaythree,OUTPUT);
    pinMode(roelayfour,OUTPUT);
    
    //start Ethernet 
    Ethernet.begin(mac, ip, gateway, subnet); 
    server.begin(); 
}

    void loop(){ 
    // Create a client connection 
    EthernetClient client = server.available(); 
    if (client) { 
        while (client.connected()) { 
            if (client.available()) { 
                char c = client.read();

                //read char by char HTTP request 
                if (readString.length() < 100) {

                    //store characters to string 
                    readString += c; 
                }

                //if HTTP request has ended– 0x0D is Carriage Return \n ASCII 
                if (c == 0x0D) { 
                    client.println("HTTP/1.1 200 OK"); //send new page 
                    client.println("Content-Type: text/html"); 
                    client.println();

                    client.println("<HTML>"); 
                    client.println("<HEAD>"); 
                    client.println("<TITLE> ARDUINO ETHERNET SHIELD RELAY</TITLE>"); 
                    client.println("</HEAD>"); 
                    client.println("<BODY>"); 
                    client.println("<hr>"); 
                    client.println("<hr>"); 
                    client.println("
"); 
                    client.println("<H1 style=\"text-align:center;\"> ETHERNET SHIELD RELAY CONTROL </H1>"); 
                    client.println("<hr>"); 
                    client.println("
");

                    client.println("<H2 style=\"text-align:center\"><a href=\"/?55101\"\">open</a>
</H2>"); 
                    client.println("<H2 style=\"text-align:center\"><a href=\"/?55102\"\">close</a>
</H2>");
                    

                    client.println("</BODY>"); 
                    client.println("</HTML>");

                    delay(10); 
                    //stopping client 
                    client.stop();

                    // control arduino pin 
                    if(readString.indexOf("?55101") > 0) //checks for "OPEN" command
                    {   
                          lasttime=millis();

                        while(millis()-lasttime < interval_one) //interval_one is 15000
                           { digitalWrite(relayone,HIGH); // 
                            digitalWrite(relaytwo,HIGH);
                            digitalWrite(relaythree,HIGH);
                            digitalWrite(rolefour,HIGH);
                         if(readString.indexOf("?55102") > 0) //I sent 55102  but while loop not break 
                         {
                          break ;
                         }
                       }
                           
                                lasttime=millis();

                        while(millis()-lasttime < interval_two) //interval_two is 10000
                        {
                              digitalWrite(relayone, LOW);  
                             digitalWrite(relaytwo,LOW);
                             digitalWrite(relaythree,LOW);
                             digitalWrite(relayfour,LOW);
                        }
                         } 
                   if(readString.indexOf("?55102") > 0) //checks for "close" command
                    {   
                     
                            digitalWrite(relayone,HIGH); 
                            digitalWrite(relaytwo,LOW);
                            digitalWrite(relaythree,HIGH);
                            digitalWrite(rolefour,HIGH);
                    }
                   
                    
                         //clearing string for next read 
                    readString="";

                } 
            } 
        } 
    } 
}
                    if(readString.indexOf("?55101") > 0) //checks for "OPEN" command
                    {   
                          lasttime=millis();

                        while(millis()-lasttime < interval_one) //interval_one is 15000
                           { digitalWrite(relayone,HIGH); //
                            digitalWrite(relaytwo,HIGH);
                            digitalWrite(relaythree,HIGH);
                            digitalWrite(rolefour,HIGH);
                         if(readString.indexOf("?55102") > 0)

A GET request usually contains name=value pairs. The first is separated from the script name by a ?. The others are separated by &. If the GET request is properly formatted, it is extremely unlikely that it contains two question marks.

first of all thank you for help me
Actually I did not understand exactly Would you please explain a bit? where did i make mistake ?

best regards

where did i make mistake ?

You check for the string "?55102" in the GET request only if the GET request contains "?55101". In my experience, that is not going to result in both if statements evaluating to true.

Apparently, you expect the contents of readString to change while the if statement and while loop are running. That is not the case.