G'day Benno.
It's unlikely you'll need to re-wire it.
More likely just an earth or corrosion problem.
That said, I had to replace the wiring on my trailer recently because the wiring was corroded.
If you can strip back a bit of wire and the copper is nice and shiny it's fine. This needs to be the case both ends.
To diagnose the problem, you'll need either a multimeter, continuity tester, or a test light.
Start at the car and make sure that the earth pin does indeed have a good connection to the vehicle earth.
Then make sure you have power going to all the right connections by running your test light or multimeter from each pion in turn to earth.
If that all checks out, go to the back and make sure you have power to the back end of the lights and that the earth has continuity.
A multimeter is best because you can measure resistance as well as voltage.
A continuity tester or test light will tell you if you power or no power, but won't tell you how good the connection is.
Also bear in mind that the pins and sockets are brass, so they wear in time which means they are less likely to have a good connection as they get older.
Replace them if wear is noticeable and lubricate them regularly.
Which pins are which will depend on the type of plug you have , but assuming it's a 7 pin it is
1 Left indicator Yellow
2 Auxiliary Blue
3 Earth White
4 Right indicator #Green
5 Auxiliary Black
6 Brake #Red
7 Tail/number plateBrown
The auxiliaries will be your brakes, reversing lights etc.
Not sure what the standard is as to which is which.
cheers,
Owen