What is the best practice for redirecting URLs in PHP using htaccess?

When redirecting URLs in PHP using htaccess, it is best practice to use the RewriteRule directive in the .htaccess file to specify the old URL and the new URL to redirect to. This allows for seamless redirection of users from the old URL to the new URL without changing the URL displayed in the browser.

RewriteEngine On
RewriteRule ^old-url$ /new-url [R=301,L]