The simplest solution is really to put very little hay in the litterbox and more hay in the hay-rack or a separate bowl or sth. When he is used to doing his business in the box, he will keep doing it there. When I changed litter from Yesterdays News to wood stove pellets, I stopped feeding hay in the litter-boxes because it is possible that it’s not good for rabbits to spend a lot of time close to wood-stove pellets (they emitt some carbon monoxide), but both boys kept their litterbox habits just like always.
I’ll readily admit hay is a problem though. They always want to scatter it. My apt is full of hay. I even have haystrands in my gymclothes.
I think I saw a pic here of a really clever hayrack attached to a litter-box that a bunny-owner here had made. So the hay was not actually lying in the litterbox, but the bunny could still eat from it when he/she was hanging out in the box. Perhaps it was in the habitat-section.