The LORD said to Joshua, "Don't be afraid or terrified. Take the entire army with you. Start to go up to Ai. Look! I have given the king of Ai, his people, his city, and his land into your power.
References for Joshua 8:1
Do to Ai and its king what you did to Jericho and its king. But you may take its booty and cattle as plunder. Set your ambush behind the city."
So Joshua and the whole army got ready to go up to Ai. Joshua chose thirty thousand brave soldiers. He sent them out by night.
He commanded them, "Look. You are to ambush the city from behind. Don't move too far away from the city. Be ready, all of you.
I will approach the city with all the people. When they come out against us the same way as before, we will flee from them.
They will come out after us until we have drawn them away from the city. They will think, They are fleeing from us as before. So we will flee from them.
But you will rise up from the ambush and take over the city. The LORD your God will give it into your power.
As soon as you seize the city, set it on fire. Act according to the LORD's word. Indeed, I have given you an order!"
Joshua sent them off, and they went to set the ambush. They stayed between Bethel and Ai, to the west of Ai. Joshua spent that night among the people.
Joshua got up early in the morning and mustered the people. Then he and the elders of Israel went up in front of the people to Ai.
The entire army that was with him went up. They moved in close, in front of the city. Then they camped north of Ai, with the valley between them and Ai.
He took about five thousand men and positioned them as an ambush between Bethel and Ai to the west of the city.
The people positioned the main camp on the north side of the city and its rear guard on its west side. That night, Joshua went into the middle of the valley.