why is konichiwa written that way

Im just starting to learn japanese and im learning hiragana and I was wondering why konichiwa is spelt like こんにちは and not like こんいちは because why is there n and ni, and not just n and i.

by krazy15b