Here is a great list of code snippets and scripts for .htaccess file to optimize your website in many ways like redirection, performance, ease of use, security and more!