First, I would clear your code. You don't need php tags, you use smarty:
{if substr($url,0,4) neq 'http'}
section 1
{else}
section 2
{/if}
This is untested, but should be pretty close.
, - , , , HTTP_HOST, - :
{assign var='url' value=$smarty.server.HTTP_HOST}
{if substr($url,0,4) neq 'http'}
section 1
{else}
section 2
{/if}