Speaking of using XP to accomplish this goal, why not just make it simpler? Require a minimum of 6 encounters a day, and if the PCs long rest before that they don't get the full XP for the day but see it reduced by 16% for each missing encounter that day?
I toyed with a similar idea of delaying leveling based on the number of long rests taken. The idea was that if you rested too much, you didn't learn as quickly because you weren't experiencing life or death situations. But in the end it still left too many pointless combats where the PCs dominated.
I don't think I explained this very well, and also realized that I need a small tweak to account for failing in combat. First the revised rule.
XP Based Rest Variant
Adventurer's and monsters draw their extraordinary powers and resilience to damage directly from the Positive and Negative planes. When you defeat other NPCs and monsters, you gain some of their power as you absorb lightning-like energy from your defeated foe. In addition to tracking XP for level advancement, players also need to keep an XP Rest Count.
When you collect 1/3 and then 2/3s of your daily XP budget since your last long rest, you gain the benefit of a short rest. You can also gain this benefit from an 8 hour rest in a safe location, but doing so also resets your XP rest count to 0.
When you collect XP equal to or greater than your daily XP budget since your last long rest, you gain the benefit of a long rest. You can also gain this benefit from a 7 day rest in a safe location. Your rest count resets to 0 after either type of long rest.
Example
OB1 is a first level monk traveling alone through a forest to his grandmothers house.
OB1s daily budget is 300xp. He will receive short rest 1 when he gets 100xp, short rest 2 at 200xp, and a long rest at 300xp
On the way to grandma's house, OB1 is attacked by 2 giant rats and defeats them (50xp Medium difficult encounter)
OB1, to gain the benefit of a short rest, would need to rest for 8 hours or get in one more Medium difficulty fight. OB1 decides to press on.
Later, OB1 is attacked by a wolf and defeats it (50xp Medium difficulty encounter). At the end of the fight, OB1 immediately gains the benefit of a short rest, and can choose to spend hit die, which he does.
As OB1 approaches his grandma's house, he is attacked by an Orc! He fights valiantly and defeats it (100xp, Deadly difficulty encounter) and immediately gains the benefit of a short rest. He has no more hit die left, so he can't recover hit points.
At this point, OB1 can either press on to Grandma's, or he will need to take a week rest to regain his hit points and hit die. He decides to press on.
As he reaches grandma's house, a lone Orc is axing through the door. OB1 rushes it, and defeats it! OB1 gains the benefit of a long rest and also level's up! Way to go OB1!
Had OB1 bailed after the first Orc fight and returned home to rest, he would still have 200xp towards level advancement, but when he set off on the path again a week later, his XP Rest count would be at 0. After fighting the second Orc, he would reach level 2, but would need to take another week off to get a long rest or would now have to get to to 600 XP to get the long rest benefit (200 and 400 for short rest 1 and 2).