Fixed: Broken attachment links when using mod_sef. Closes #677