The contents of this .htaccess file have been carefully pieced together to provide answers for common enviromental setups for all websites hosted on servers that support .htaccess configurations. It will work well with the Google Page Insight tool. Here are the sections it addresses:
CROSS-ORIGIN
ERRORS
INTERNET EXPLORER
SECURITY
This .htaccess configuration works with static sites and any dynamic ones as well, like WordPress. Append the contents of this file to your working .htaccess file if you are running a website hosted on an Apache websever.
Websites hosted on different HTTP web servers
Not all hosting companies use Apache as their HTTP serving server. Other popular software for running web servers are available. In case your website is hosted on one of the above HTTP servers and not .htaccess you need not worry, as there are options to convert the configuration of the .htaccess file for them too.