Redirect Old Domain to New Domain via .htaccess

Usually we develop the site on developement or subdomain and when we finally mirgate the to new domain then some of thing will remain or page redirect happens in  sometimes , so In this case .htaccess file helps to redirect all your olddomain pages to new one 

Below is the code will helps to redirect the olddomain to new domain, should be written in .htaccess file on your root folder