<?php
header('Location: https://another-url.com/'); /* 브라우저는 https://another-url.com/로 리다이렉트 함 */
exit; /* 리다이렉트 시 이전 URL의 코드가 실행되지 않도록 합니다. */
header('Location: URL');
<!DOCTYPE html>
<html>
<body>

<?php
header('Location: https://another-url.com/');
exit;
?>

</body>
</html>
<?php
echo '페이지를 준비하고 있습니다.';

header('Location: https://another-url.com/');
exit;
  <?php
header('Location: https://another-url.com/');
exit;
 
<?php
header('Location: https://another-url.com/');
exit;
<?php

header('Location: https://another-url.com/');
exit;

// 이 코드는 실행될 수 있습니다.
echo '리다이렉트 이후의 코드';
<?php

header('Location: https://another-url.com/');
exit;

// 이 코드는 실행되지 않습니다.
echo '리다이렉트 이후의 코드';