Front-loader machine wash on the perm-press cycle (medium spin speed); dryer gets set to "low".
Shorts that I've had for at least five years, wearing probably 50-60x/year, still feel as good as day one.
Back in the olden days of a leather chamois (I had one pair of shorts with the leather....and that was enough!) ...that was a whole other kettle o' fish!