What are the limitations or challenges of implementing .htaccess for webpage redirection in PHP on different server types?

When implementing .htaccess for webpage redirection in PHP on different server types, one challenge is that not all servers support .htaccess files or have mod_rewrite enabled. This can lead to inconsistent behavior or errors when trying to redirect URLs using .htaccess. To address this issue, you can use PHP to handle the redirection logic instead of relying on .htaccess.

<?php
// Redirect to a different page using PHP
header("Location: https://www.example.com/new-page.php");
exit();
?>