Having 5 weeks makes a big difference. Usually people asking this kind of question have something more like 6-10 days, I think the first few replies (including mine) are influenced by that.
As Veta said, Croatia Airlines often have quite reasonable fares from Dubrovnik and Zagreb, but like anywhere else it depends on whether you are travelling on a popular day and how far in advance you book. It's easy to check because Croatia Airlines are the only airline with domestic flights within Croatia, so you can just look at their website to see how much you'll pay.
But with 5 weeks there's no real need to fly. For example you could go from north to south stopping at certain places, and back from south to north with different stopovers, so no single journey will be really long. Or you could take ferries in one direction and buses the other.
I'd say a couple of days in Zagreb are worthwhile as part of such a long stay in Croatia. Sure, it's not one of the greatest Central European cities and it doesn't have loads of must-see sights, but I rather like it. It is quite different in atmosphere and architecture compared to the coastal towns, and that contrast is interesting in itself to get a more rounded picture of the country. Plus Mirogoj Cemetery is great (but then I am a bit of a graveyard fan). As Jeroen mentioned, high summer might not be the ideal time to visit.
You could also consider a few days in Bosnia. This would fit nicely with starting and ending in the same place, whether Zagreb or Dubrovnik, as it would allow you to form a nice looped itinerary. For example, fly to Zagreb, visit Plitvice, make your way slowly south along the coast and islands to Dubrovnik, bus to Mostar, bus or train to Sarajevo, bus or train (full day) to Zagreb. That route works equally well starting in Dubrovnik.