How can PHP be used to maintain the original URL in the address bar during a frame redirection?

When using frames in HTML, the original URL in the address bar can be lost when navigating between frames. To maintain the original URL in the address bar during a frame redirection, you can use PHP to set the location header to the desired URL. This way, the address bar will always display the original URL regardless of the frame content.

<?php
if(isset($_GET['redirect_url'])) {
  header("Location: {$_GET['redirect_url']}");
  exit();
}
?>