The Mansfield Town academy product joins from Altrincham, who he joined on loan from Stags in November last year.
Smith made his first-team debut for Mansfield on 13 November 2018, in the Football League Trophy, and signed a new 18-month contract with the club in January 2019.
Altrincham director Rob Esteva told the club’s website: “We are naturally disappointed to lose Ali but he leaves with our best wishes. He joined the club desperate to play first-team football and kick on with his development, and it is clear to see he has done just that.
“At the time of signing Ali on a permanent deal, the key factor behind getting it over the line was the inclusion of a buy-out clause to enable him to return to the EFL if the opportunity arose.”