A dangerous trail through the West Balkans is currently the main entry route into Europe for migrants fleeing war and upheaval. But parts of the route have been blocked in recent months with razor-wire fences and other border controls, forcing migrants to take paths that are more dangerous.

Greece built a razor-wire fence in 2012 to block a short stretch of its border with Turkey that was a popular land crossing for migrants. It also increased security along the Evros River, which forms the remainder of the border. This is the first of several barriers that merely diverted the flow of migrants from Turkey, pushing them to Bulgaria or onto boats headed for Greek islands in the Aegean Sea. Above, an overcrowded dinghy with Syrian migrants arrives on Lesbos Island, Greece.

Bulgaria responded to the influx of migrants diverted from Greece by starting construction of its own fence on the border with Turkey, above, in 2014. Bulgaria’s fence and border control efforts reduced illegal crossings by more than half last year. Most migrants are now forced to take sea routes.

Thousands of migrants per day on their way north have moved through the tiny nation of Macedonia in recent weeks, crossing the border next to railway lines near the town of Gevgelija. The government tried to prevent migrants from crossing the border in August, creating crowds at the border, above, that clashed with the police. But the next day, the migrants were allowed in. Macedonia has since focused on quickly moving migrants north to Serbia.

Hungary hastily constructed a 109-mile razor-wire fence this year along its border with Serbia, but migrants have climbed over or crawled under it. Above, migrants crossed the fence near Roszke last month. On Wednesday, the Hungarian police fired water cannons and tear gas at hundreds of migrants trying to break through a gate in the fence.

Thousands of migrants were stranded in Serbia as Hungary reinforced the border and said it would prosecute and imprison anyone entering the country illegally. The measures shifted the flow of people yet again, diverting some through Croatia en route to Slovenia and Austria and potentially diverting others through Romania. In anticipation of the shift, Hungarian officials said Tuesday that they would start building a new razor-wire fence on part of Hungary’s border with Romania.