Alaphilippe has four riders within two minutes 02sec of his advantage as the Tour goes into three huge Alpine stages with defending champion Geraint Thomas at 1min 35 sec behind him in one of the most open races in years.
In his yellow jersey for a 13th day, the world number one looked relaxed after the balmy run from the Camargue into the town of Gap, surrounded by the daunting mountain peaks which lie in wait for the peloton.
"It was a peaceful day, it did me good, we reserved energy in this dreadful heat," said Alaphilippe.
"I'm ready for the Alps," added the 27-year-old former soldier.
"But I need to detach myself from all this going on around me," he said.
"My legs are tired, but in my mind I have never felt better," he added.
Rivals have been predicting local hero Alaphilippe would crack under pressure since he took the overall lead but Thomas' co-captain Egan Bernal lying in fifth overall was unsure.
"We all said he'd lose the lead in the Pyrenees, but here we are with just three stages remaining and he's still there," said Team Ineos' Colombian.
"Hats off to him, he's the one in the lead and he looks strong. But at last we are in the Alps," said impressive climber Bernal, the youngest man in the race.
The victory for Trentin, 29, came after he surged forward alone from a mass breakaway 20 minutes ahead of the main pack, and is a fourth win on the 2019 Tour for the Mitchelton-Scott team after Simon Yates' double and Daryl Impey's victory.
"It's never easy, I was sitting there studying everyone, when it kicked off I just stayed calm in the attacks and I made the move at the right time just ahead of the climb, which won the race," said Trentin, who now has three stage wins on the Tour de France.
"All wins are nice, but I have been chasing this one for a while," he added.
The heatwave was a worry at the first century Roman aquaduct Pont du Gard where the stage started, with hundreds of fans seeking refuge from the searing conditions by splashing around in the Gardon river.
But Trentin, Olympic champion Greg van Avermaet and six other previous Tour stage winners led a group of 33 riders on a burning pace covering the first 100km in two hours.
Results from stage 17 of the Tour de France from Pont du Gard to Gap on Wednesday:
1. Matteo Trentin (ITA/MIT) 4hrs 21min 36sec, 2. Kasper Asgreen (DEN/DEC) at 37, 3. Greg Van Avermaet (BEL/CCC) 41, 4. Bauke Mollema (NED/TRE) 41, 5. Dylan Teuns (BEL/BAH) 41, 6. Gorka Izagirre (ESP/AST) 41, 7. Daniel Oss (ITA/BOR) 44, 8. Pierre-Luc Perichon (FRA/COF) 50, 9. Toms Skujins (LAT/TRE) 50, 10. Jesus Herrada (ESP/COF) 55, 11. Simon Clarke (AUS/EF1) 1min 23sec, 12. Lukas Poestlberger (AUT/BOR) 1:23, 13. Edvald Boasson Hagen (NOR/DDT) 1:26, 14. Vegard Laengen (NOR/UAE) 1:26, 15. Sergio Henao (COL/UAE) 1:35, 16. Nicolas Roche (IRL/SUN) 1:44, 17. Benjamin King (USA/DDT) 2:53, 18. Jasper Stuyven (BEL/TRE) 2:53, 19. Sven Erik Bystrom (NOR/UAE) 2:53, 20. Xandro Meurisse (BEL/WGG) 2:53.
34. Julian Alaphilippe (FRA/DEC) 20:10.
38. Geraint Thomas (GBR/INE) 20:10.
39. Egan Bernal (COL/INE) 20:10.
51. Steven Kruijswijk (NED/JUM) 20:10.
57. Nairo Quintana (COL/MOV) 20:10.