What's the correct way to rig this vehicle?

I’m trying to set up this chaos vehicle, which basically acts as a two wheeled vehicle with a trailer:

Imgur

How should I have my bones set up? Every setup I try results in the back section rotating weirdly, usually pointing up or down and to the side, or the wheels sink through the floor and nothing works. (Below is the result of the above skeleton)

Imgur

There shouldn’t be anything wrong with the vehicle blueprint since I previously got it working by treating the front and back as one piece, so I assume it’s either the bone placement or hierarchy I can’t get right.

Update: I’ve been learning about constraints, and I think the bone structure is correct now but the trailer now slides when I turn instead of following the front naturally.

… where have you ever seen a vehicle with just 2 wheels in its mid point?

It’s one thing if it is being dragged.
From what you said and the picture it looks like the opposite.

either way
Cheat it.
Make a rig with 4 wheels for each section regardless of what it actually has.
Then simply keep the wheels as invisible. If you place them smart enough you won’t even have collision issues.
Oh, and like anything being dragged (chariots in my case) it’ll be a LOT more stable.