开发者

Can I configure Apache to redirect at a specified timeout?

开发者 https://www.devze.com 2023-03-21 09:17 出处:网络
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.

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

精彩评论

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

关注公众号