Trains then trams, buses, cars etc were commandeered to transport the troops as close as possible but as often as not it was down to good old shanks pony, which is why you often see in old WW1 film footage long lines of men heading to the front while equally long lines of wounded headed the other way. I'm sure if you spend 10min on google you will find lots of photos