开发者

Can I configure Apache to redirect at a specified timeout?

I How to configure Apache so I can redirect to another page on a开发者_如何学C specified TimeOut. Is this possible?


Didn't find any possible solution how to do this in Apache.

Still, if you are using PHP, try playing with PHP register_shutdown_function function.

Sample code:

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

register_shutdown_function('shutdown');

while (true) {}

define('FINISHED', 1);

Still this will be executed on fatal errors as well and after manual die() or exit() calls inside your scripts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜