It looks that I found the solution to my problem, the first skecth was working correctly because the **SD card is using the pin 4 his purpose**, so the sketch was working good becuse the SD card was not used here, in the second code where I used th SD card to serve a webpage **was not working anymore not because of the code, but becuse the PIN 4 where I connected a led was used by SDcard** and so it messed up by blinking the LED **DON'T USE PIN4 WITH AN ETHERNET SHIELD IF YOU PLAN TO USE THE SD CARD**