A by-way is a little path aside from the main road. A by-product is a less important product aside from one's main aim. So I had always assumed that a by-law was a little law aside from the laws of the land. I was wrong.
If you want to know about the by in by-law you should investigate in Derby, Whitby, Rugby, Grimsby, Selby, Ashby Puerorum or any of the towns in the north eastern quarter of England that end with the letters -by.
Why are all those towns in the North East? Because they were all named by the marauding Vikings who ravaged and raped and pillaged their way around England until Alfred the Great made them stop. In fact, you can work out the line of the Vikings' farthest advance by simply pulling out a map of Britain and searching for the -bys.
By was simply the Viking word for town, and if you go to Norway or Sweden it's still the word that those unrepentant marauders use. So what do you call a law that only applies in this town? That's right, you call at it a by-law.
P.S. The media maelstrom that is The Etymologicon continues. Not only was I on the radio again last night way past my bedtime, but there's a piece in today's Daily Mail. The book will be lolling in the shops on Thursday. And, if you're in another country or can't make it to a bookshop, you can order it with free shipping to anywhere in the world from this website.