But even published adventure paths don't always signal "This Strategy Is Not Part Of The Path"--so what techniques do you use to signal to players what is and isn't on the path?
Like if they go "Ok we sneak into the goblin camp using an illusion" do you just go "That's not on the path, investigate what happened to MeadowTown instead"? How does it work?
You seem to be looking for very specific answers to very generic questions. OK, the players want to sneak into the goblin camp. Is it written up as part of the AP? Then they are now sneaking through the goblin camp using an illusion, and I can adjudicate what happens using the writeup of the goblin camp.
Is it not written up? Then why are they near a goblin camp to sneak into it in the first place? Assuming they are near a goblin camp that, for some inexplicable reason, the published scenario assumes they will just ignore, then I hopefully have thought "WTF? Why would the players ignore the goblin camp??" and either removed it entirely, replaced it with something else they won't see a need to investigate, provided reasons for them to see some urgency to moving on to MeadowTown or written up the goblin camp so I am able to adjudicate what happens using the writeup of the goblin camp.
What if 3 PC's continue on to MeadowTown and two slip into the Goblin Camp under an illusion. Even sandboxes tend to find a split party a pain in the posterior. Hey. maybe we give them seven different choices and they each pick a different one, going their separate ways. Won't that be fun to run? Every game faces these possibilities. You run with it as a GM.
Hey, what if they look at all seven choices, say "my, those sound dangerous and uncomfortable - let's go back to town and open up a tea shoppe instead", how do you run that? At some point, the players need to take an adventure hook, or there will be no adventure. "You found a tea shoppe. It is quite successful, eventually building branches throughout the continent. You all become rich beyond imagination, sire many sons and eventually die peacefully in your sleep after long, happy and completely adventure-free lives." The next party can even coincidentally meet in the local branch of the Five Halflings Who Avoided Adventure All Their Lives Tea Shoppe instead of the cliché tavern, from whence they will begin lives that hopefully have more adventure in them.
In an AP, they might well investigate the goblin camp, and find some further indication of why they should go to MeadowTown. Or they have now dealt with those distracting goblins, so on to MeadowTown (as they had nowhere better to go). Or they have the loot from that goblin camp, including 7 bolts of fine silk and a mahogany dining room suite. My, they are heavy. And we need more provisions. And arrows. Where can we go? Well, the closest settlement of any size is MeadowTown, so off we go to unload this loot and reprovision.
Like, if your players think up a tactic not accounted for in the module then solve the bad guy problem in a way not anticipated then a whole chain of events planned for that path is derailed and you're not on the path anymore, right?
It's tough to provide a specific answer without a specific question...Let's assume that the BBG, for some inexplicable reason, rides a horse past the PC's in the start of the AP. Despite not knowing he is destined to become the BBG, Claude the Chaotic decides to "waste him with my crossbow", and rolls a critical hit for max damage killing off the BBG instantly. "Oh well, throw out those six modules at Page 3 because it's all over?" Probably not. More likely, some other member of the organization steps into that BBG's shoes, Claude is hauled off to justice by Percy Paladin, his player leaves the group because "player agency is violated when players other than me exercise it" or some such nonsense, and we carry on, with the "BBG" just a footnote.
If the BBG was Lolth, Queen of the Spiders, I'm guessing she does not make an appearance before our novice L1 adventurers, and if she does, and is attacked, perhaps the NEXT party will demonstrate more common sense.
Most of the AP's (which are a pretty recent innovation over the old 32 page module) provide guidelines on what to do if something unexpected happens, like a key NPC dying at an inopportune time (or surviving when he wasn't expected to). If not, they provide lots of overall detail, so putting the plot back on the rails is far from impossible.