Back to previous page in AJAX Call

I'm not certain I understand you completely. However...

$previous = "javascript:history.go(-1)";
if(isset($_SERVER['HTTP_REFERER'])) {
    $previous = $_SERVER['HTTP_REFERER'];
}

For redirecting with PHP

header("Location: $previous");

For testing with a HTML link

<a href="<?= $previous ?>">Back</a>

I hope this is helpful.


To Redirect to the Previous worked page.

window.history.back();

or

history.back();

It redirects to the previous page that we used to work. but when you want to redirect to the particular URL you can use that link in the href tag.

click Here for Reference the link tags