Before this , the county had been a part of the Mississippi Territory until 1817 when the area passed into the Alabama territory Previously , the county had been a part of the Mississippi territory until 1817 when the area passed into the Alabama territory .