diff --git a/route.php b/route.php index 5f08e4e..82a82ee 100644 --- a/route.php +++ b/route.php @@ -104,8 +104,9 @@ class route If module is set, the site is modular and a directory is named with module name @param string $destURL Do a redirection of the HTTP page - @param string $module The module name */ - function redirect ($destURL, $module) + @param string $module The module name + @param boolean|null Permanent redirect (false by default) */ + function redirect ($destURL, $module, $permanent = false) { if (php_sapi_name () === "cli") exit; @@ -151,6 +152,8 @@ class route { header ("Cache-Control: no-store, no-cache, must-revalidate"); header ("Pragma: no-cache"); + if ($permanent) + header ("HTTP/1.1 301 Moved Permanently"); header ("Location: $destURL"); } else