What are some best practices for displaying a message about a server migration before redirecting in PHP?

When migrating a server in PHP, it is important to display a message to users informing them of the migration before redirecting them to the new server. This helps to minimize confusion and ensure a smooth transition for users. One best practice for displaying a message about a server migration before redirecting in PHP is to use a simple HTML message that informs users of the migration and provides any necessary instructions or information. This message can be displayed using a header function before redirecting users to the new server.

<?php
// Display message about server migration
echo "<p>Our server is currently undergoing maintenance. We apologize for any inconvenience. Please try again later.</p>";

// Redirect users to the new server after a few seconds
header("refresh:5;url=https://newserver.com");
exit;
?>