What are the potential pitfalls of using relative URIs versus absolute URIs in the header() function in PHP?

Using relative URIs in the header() function in PHP can lead to issues when the browser interprets the URL relative to the current page's location, potentially resulting in incorrect redirections or broken links. To avoid this problem, it is recommended to use absolute URIs instead, which provide a complete path to the resource regardless of the current page's location.

// Using absolute URI to redirect to a different page
header("Location: http://www.example.com/new_page.php");
exit();