The 32 year old defender made 27 appearances for the Millers last season.
On joining Town, boss Simon Weaver said; "He's an absolute winner and we're delighted to have him at the club, You can tell by meeting him and from everyone's feedback just how hungry a player he is,"
Meanwhile Mattock said; "I played Harrogate last pre-season and they ran us off the park a little bit, It was a tough game, they played some good football and have got some quality players, a few of which I know. I'm looking forward to joining up with them and seeing what I can add to the group."