"Due to the restrictions introduced by Germany and Austria, the entrance (to Slovenia) will be allowed only to migrants that express their intention to apply for asylum in Austria or Germany," Interior Minister Vesna Gyorkos Znidar told a news conference.
The restrictions on the border will enter into force with the arrival of the next train from Croatia, scheduled for 10:00 pm (2100 GMT), Gyorkos Znidar said.
Slovenia will also beef up the control of its 670-kilometre-long (410 miles) so-called "green border" with Croatia to prevent illegal crossings.
The Austrian government announced Wednesday it would cap the number of asylum-seekers and would begin turning back any new arrivals seeking to claim asylum in Scandinavia.
Slovenia, a tiny former Yugoslav state of two-million people, became the main transit country for migrants heading for Austria and Germany after Hungary closed its borders to migrants in mid-October.
Over 420,000 migrants have crossed Slovenia since then, almost all of them heading for Austria.