{if $smarty.server.SERVER_PORT == 443} secure path and code goes here {else} non-secure path and code goes here {/if}