divide index file to header and footer