Prevent 404's caused by attachment link workaround.

Fixes #5975