The locations that are most strongly affected by an earthquake are generally those closest to the fault that caused it. However, this is not always the case, because site effects can amplify the seismic signal.
Places underlain by soft sediments, such as alluvial valleys (house on the left in Figure 1), may experience much stronger shaking than sites on bedrock or firm soils (house on the right). Sediments tend to increase seismic-wave amplitudes and lengthen their periods.

Figure 1.
Depending on the shape of the valley or sedimentary basin and irregularities in the underlying bedrock, waves may also become "trapped" and reflect back and forth, prolonging the duration of shaking.