I am developing an impresspages plugin where I need a redirection. For such a thing I catch the event ipInitFinished
, v.g., creating a code like this:
class Event {
public static function ipInitFinished()
{
if( !(ipIsManagementState()))
{
$site = ipHomeUrl();
$page = ipGetOption('SiteMaintenance.messagePage');
header('location: ' . $site.$page);
exit;
}
}
messagePage is a field of the plugin that store the page name to display on redirection. This page is a normal page created in impresspages environment.
However, when the plugin routine is executed the browser raise an error related to looping or recursive redirect.
How to solve this?