Remove file extensions with multiple segments