我可以将Apache配置为在指定的超时重定向吗?

我可以将Apache配置为在指定的超时重定向吗?,apache,apache-config,Apache,Apache Config,我知道如何配置Apache,以便在指定的超时时间重定向到另一个页面。这可能吗?没有找到任何可能的解决方案,如何在Apache中做到这一点 不过,如果您使用的是PHP,请尝试使用PHP的register\u shutdown\u函数 示例代码: set_time_limit(1); function shutdown () { if ( ! defined('FINISHED')) { header('Location: /timeout'); } } regis

我知道如何配置Apache,以便在指定的超时时间重定向到另一个页面。这可能吗?

没有找到任何可能的解决方案,如何在Apache中做到这一点

不过,如果您使用的是PHP,请尝试使用PHP的register\u shutdown\u函数

示例代码:

set_time_limit(1);
function shutdown () {
    if ( ! defined('FINISHED')) {
        header('Location: /timeout');
    }
}

register_shutdown_function('shutdown');

while (true) {}

define('FINISHED', 1);

尽管如此,这也将在致命错误上执行,并且在脚本中的手动死亡或退出调用之后执行。

没有找到任何可能的解决方案如何在Apache中执行此操作

不过,如果您使用的是PHP,请尝试使用PHP的register\u shutdown\u函数

示例代码:

set_time_limit(1);
function shutdown () {
    if ( ! defined('FINISHED')) {
        header('Location: /timeout');
    }
}

register_shutdown_function('shutdown');

while (true) {}

define('FINISHED', 1);
尽管如此,这仍然会在致命错误上执行,以及在脚本中的手动死亡或退出调用之后执行