The short version is that self-loading pistols require different technologies and have different requirements compared to self-loading service rifles.
Pistols, being designed with smaller size and weight in mind, chamber fairly weak cartridges. Working pressures are low, and thus weaker and simpler mechanisms are possible while keeping the overall size and weight low. For reference, the .32 ACP cartridge that was popular for pistols at the time was light enough to be used in direct blowback designs - only a spring and the inertia of the system held the gun closed as it fired. However, direct blowback designs depend on the inertia of the system and thus rapidly increase in weight as the cartridge increases in size. The WW2-era Astra 400, for example, is a direct blowback 9mm that has a notably heavy slide because the system is designed around a cartridge that typically has a locked-breech design. But when we start scaling up to service rifle cartidges, the weight necessary becomes unworkable. The bolt alone for a blowback design chambered in .308/7.62 NATO (roughly equivalent to WW1 service cartridges), for example, would have to be almost 12 pounds.
What about locked breech designs? The systems that immediately come to mind are the Browning tilting barrel, Luger toggle lock, and Mauser short-recoil systems. All of these had their issues, however - in addition to being poorly suited to scaling up to larger cartridges, all three of these mechanisms involve some degree of movement of the barrel. This is fine for a handgun, but it massively complicates things for rifles, as things like bayonets and handguards cannot be fitted directly to the barrel. But don't discount the idea that the mechanisms themselves don't scale up well. Handgun cartridges are low pressure compared to rifles - .32 ACP barely breaks 20,000 psi, .45 ACP is closer to 25,000 psi, and 9mm Parabellum reaches a whopping 35,000. America's 30-06 rifle cartridge, meanwhile, was loaded for 50,000 psi, with proof loads of 75,000.
That's not to say that there wasn't effort prior to the start of the war on self-loading rifles. Paul Mauser had developed a short-recoil self-loading rifle in 1898, though that particular example catastrophically failed and cost Mauser an eye. And that gives us a good hint as to the difficulty of self-loading rifle development. Rifle cartridges were much more powerful than pistol cartridges and were less forgiving for inventors. Even John Browning for all his genius wasn't particularly ahead of the curve on the issue. Though he invented a machinegun in the 1890s, his first self-loading rifle - the Remington Model 8 - wasn't ready until the turn of the century. The French were looking to adopt a self-loading rifle to replace the Lebel, and they had even selected the Meunier A6 in 1913 to enter service. Like Mauser's rifle, the Meunier was peculiar in retrospect, as it used a long-recoil system. Unfortunately, the outbreak of war forced them to drop the design, since it entailed not just a new rifle, but adoption of a new cartridge to go with it.
Ultimately, the French would go on to adopt the only self-loading service rifle of the war - the RSC 1917. The RSC was a gas-operated rotating bolt design fed by an en-bloc clip. While successful, this mechanism was a far cry from that on any pistol of the time, as well as a complete departure from the recoil-operated designs that had been the norm for self-loading rifle development in the pre-war era.