The site I’m working on right now requires users to be logged in before they can access the main site. There’s a template group of login templates, the “index” of which is the home page of the site. If users are already logged in, they are redirected to the main site:
{if logged_in}
<meta http-equiv="refresh" content="0;url={path=home/index}"/>
{/if}Similarly, if users are not logged in, they are redirected to the login pages:
{if logged_out}
<meta http-equiv="refresh" content="0;url={path=site_index}"/>
{/if}However, with this rather ugly method there is a delay, such that the original page is displayed briefly before the redirect kicks in.
Is there a better method I can use to achieve the same effect? Does EE have a native redirect function I can put in templates that will work more smoothly and avoid the brief display of the initial page?