Redirect 如何让我的长时间运行的多重定向脚本绕过“;页面未正确重定向”;错误?

Redirect 如何让我的长时间运行的多重定向脚本绕过“;页面未正确重定向”;错误?,redirect,http-headers,Redirect,Http Headers,我有一个脚本,大约需要5分钟,必须运行多次。所以,我把它作为一项计划任务设置在CF管理员上。(尽管它是一个php脚本)基本上: <?php $n = $_GET['n']; // do a bunch of stuff, with $n $url = 'https://example.com/?n='.$n +1; header("Location: $url"); exit();

我有一个脚本,大约需要5分钟,必须运行多次。所以,我把它作为一项计划任务设置在CF管理员上。(尽管它是一个php脚本)基本上:

<?php
$n = $_GET['n'];
// do a bunch of stuff, with $n

$url = 'https://example.com/?n='.$n +1;
header("Location: $url");
exit();