Is there any reason you need to drive the amp at high power while you are using headphones?
The only circumstance where I can think of a reason to do that is an electric guitar amp being pushed into the desired kind of distortion. Since we're already wasting huge quantities of power in such a case - or at least a few watts - and the point is to *make* it sound "bad", but in a good way, quibbling over the impedance issues or power list in a resistive attenuator is not worth much effort. Various devices allow such crazy tube watts to feed a line-level input in a sound system, or phones, I suppose.
Otherwise, turn the amp down, so you don't have to drop so much power to begin with. You (usually) don't need to drive an amp to full power to make it work right. And in many cases, unless you're going for phoolery, that might be sufficient. You would, of course, start with the signal at zero, and work your way up from there (carefully). (The fact is, most people would be shocked at how little power they're actually using when they listen through speakers.)
If that's not sufficiently controllable, like the gain is just so low that the knob is twitchy, use a resistive divider to take care of the remaining TooMuchNess. The personal effort in this case would be to study attenuators, starting with what's already been said here.
If the idea is that you don't want to blow up your headphones when you switch over from speakers, you need a protection circuit, not an attenuator.