This is a redirect 301 macro for famous honourable WebGUI CMS.
It is very easy to use, just type like this:
SetRedirect("http://aulix.com/welcome");
or
SetRedirect("your-new-page");
Don't forget ^ character before the macro name.
package WebGUI::Macro::SetRedirect;
#-------------------------------------------------------------------
# This Macro is (c) Copyright Alexander B. Prokopyev, 2014
# http://aulix.com/SetRedirect
# http://aulix.com/developer
# ---
# It is provided to public under AGPL v3 license
# https://www.gnu.org/licenses/agpl-3.0.html
#-------------------------------------------------------------------
use strict;
=head1 NAME
Package WebGUI::Macro::SetRedirect
=head1 DESCRIPTION
Macro for redirect 301.
=head2 process ( key )
=head3 key
The key from the Session env hash to display. If the key doesn't exist,
then undef will be returned.
=cut
#-------------------------------------------------------------------
sub process {
my $session = shift;
my $url2 = shift;
if ($session->var->isAdminOn)
{
return "SetRedirect: <a href=".$url2.">$url2</a>" ;
}
else
{
$session->http->setRedirect($url2,301);
return "";
}
}
1;