What are some alternative methods to PHP header location redirects that may be more search engine-friendly?

Using PHP header location redirects can sometimes negatively impact search engine optimization (SEO) because they can prevent search engine bots from properly crawling and indexing your website. One alternative method to PHP header location redirects that may be more search engine-friendly is using JavaScript redirects. By using JavaScript redirects, search engine bots can still follow the redirect and index the new page properly.

echo "<script>window.location.replace('new_page.php');</script>";