How to add 301 permanent redirect using .htaccess?

Most of times we stuck in getting out of situations where it demands some kind of redirects whether its permanent redirect or a kind of temporary redirect (302). Permanent Redirect: If you need to change the URL of a page as it is shown in search engine results, we recommend that you use a server-side…