In some cases buildings are torn down and the haunting ceases. In other cases, the hauntings continue in the new structure. A haunting may not be tied to a location. It could be a person. Poltergeists are usually attached to children and follow them from place to place.
Curses follow people around.
There are examples of haunted houses being moved and the ghost moves with them. Like the Mt. Pleasant schoolhouse. Some ghosts are attached to cherished or religious objects, like the exhibits at the Washington State Historical Society Museum in Tacoma. The most common type of ghost seems to be a kind of snapshot in time. Frequently, violent or traumatic events seem to release an energy that imprints the action on a place or object.