Free-Conversant Support / Macro: redirect
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Macros >> Redirect

Macro: redirect

Usage:

<!--#redirect url="any valid URL"-->

Overview:

Immediately and automatically redirect the User-Agent (browser, crawler, etc.) to another page

When combined with conditional macrcos, the redirect macro provides a very powerful level of access control that would be difficult to produce any other way.

Note that this macro doesn't display anything in the page. If it runs correctly, then the page won't be displayed (the browser will be sent to another page). If an error is generated, it will be in an HTML comment and can only be seen by viewing the HTML source.

Required Attributes:

  • url="[string]": the url where the browser (or other type of User-Agent) should be redirected to

    URL should be a full internet URL, starting with the protocol (http, ftp, https, etc., etc.)

Errors:

  • Redirecting to the current page (the page that ran the redirect macro) is an error, as it could generate an endless loop.

Examples:

We can't show you a live example, as it would prevent you from seeing this page. However, here are some example ways that you might use it:

  • Redirect to a completely different site:

    <!--#redirect url="http://www.macrobyteresources.com/"-->

  • Redirect guests to the log on page:

    <!--#if condition="! userIsMember"-->
       <!--#redirect url="<!--#siteUrl-->logon"-->
    <!--#endif-->

View in DG