Tick the rules you need — HTTPS, www, caching, gzip, error pages — and copy a ready .htaccess.
In the root directory of your Apache site (or any subdirectory to scope rules to it). Apache reads it automatically if AllowOverride is enabled.
Yes. The HTTPS and www rules use mod_rewrite, and the compression and caching blocks are wrapped in
No — .htaccess is Apache-specific. Nginx uses its own server-block configuration instead.