The versatile forward, 25, has recently returned to full fitness following a shoulder injury and will look to get back up to full speed while helping the Shots climb away from relegation danger in League Two.
The former Derby, Huddersfield and Shrewsbury man is subject to a recall clause after 28 days.
Shots boss Dean Holdsworth said: "Lionel is a very exciting player who I know from my days as assistant manager of Derby County.
"He can play down the middle or on either flank and can be a real threat who possesses great quality. He is an excellent addition to the squad."
But Rotherham boss Steve Evans is ruling out the prospect of any extended stay for Ainsworth at the EBB Stadium.
Evans added: "Lionel has gone to get some first-team competitive action and that really is the sole reason why I have sanctioned the loan deal, he certainly has a future with the Millers.
"The lad is now desperate to be playing and I have listened to his request for that to happen."