The Battle of Shiloh did not occur anywhere very near to the Confederate capitol of Richmond, Virginia. The Battle of Shiloh took place in southwestern Tennessee, very near to the border with Mississippi. Richmond is in the eastern part of Virginia. To get to Richmond from Pittsburg Landing, you would have to go northeast through all of Tennessee and then east through most of Virginia. According to Google Maps, this would be a distance of over 750 miles using the highways that exist today. In the Civil War, this would have meant that it would take a very long time to get an army from the scene of the Battle of Shiloh to Richmond. In other words, this battle had nothing to do with any sort of direct threat to the Confederate capitol. Instead, it was fought because the Confederates wanted to attack the Union army under General Grant before other Union forces could join it and make it even stronger. The Union forces were there to try to move down the Tennessee River into the heart of the Confederacy. The Confederates were trying to prevent this from happening.
In short, the Battle of Shiloh was a very important battle in the Civil War, but it was not a battle that was meant to attack or defend Richmond.