Rabat is the capital of Morocco.
To get to Fes, go to the Bab el-Bouiba (one of the gates to leave the Medina) and follow the road towards the shell petrol station you can see down the lane. Across the street from the Medina there's a bus stop, go over there and ask somebody which bus to take to the road to Fes (it's one of the ones waiting there). You'll get out at a petrol station, so you can chose to ask around there or walk down the road a couple of hundred meters where there's ample space for cars to pull over, and start hitching.
South towards Casablanca, Marrakech
Take bus no. 4 or 32 from Rabat's Bab el Had to a stop called Guich Lwdaya (about 45 minutes; 3,60 dirham). From there walk in the direction the bus has come from for 100 meters or so and turn left to hitch. Have a sign.
To go to the start of the motorway you can take the tram line 1 to the final stop "Madinat al irfane", follow the road to the third roundabout and then turn right. You will come to a bridge wich crosses the national road, after this you can underpass the bridge and follow the national road (there is a sidewalk) until the road divides into the Motorway and the national road. There is a roundabout witch is a very good for hitchhiking. If you have a look at the road signs it is very easy to find but it is about 3,5 km of walking from the tram station.
North towards Tanger
Take bus no. 18 from Bab el Had to a stop called Hay Senaai. Walk back to the roundabout and hitch, best with a sign.
FInd your way towards the airport (Buses 1 and 2 go close), and you'll be on a big road leading out of Rabat / Salé towards the motorway (Avenue Hassan II). The same road also leads to the motorway towards Meknes / Fes. You can hitch this road or walk for a few kilometers until the onramp onto the motorway to Tanger. Here is a good spot to hitch.