TEXAS - Rising rents and the difficulty of securing a mortgage on the coasts have proved a boon to inland cities that offer the middle class a firmer footing and an easier life.

The country’s fastest-growing cities are now those where housing is more affordable than average, a decisive reversal from the early years of the millennium, when easy credit allowed cities to grow without regard to housing cost.

Among people who have moved long distances, the number of those who cite housing as their primary motivation for doing so has more than doubled since 2007.

Since the start of the recession, of those who moved more than 500 miles, the share who said they were chiefly motivated by housing has risen from 8 percent in 2007 to 18 percent in 2014.

During the housing bubble, when even people with modest salaries could get loans to buy staggeringly expensive homes, the cost of housing was less of a concern.

Now that getting a mortgage has become harder, the wage stagnation that has hobbled the middle class for years has deeper consequences.

“People have no choice,” said Glenn Kelman, the chief executive of real estate services firm Redfin. “They can’t move across the street; they have to move across the country.”

Here are the U.S. cities ranked in the highest "most affordable" category by Redfin: