Here are my personal htaccess settings for all my websites running on a LAMP stack. LAMP stands for Linux, Apache, MySQL, and PHP. Remember to replace with your own domain.

Outlook English

Htaccess Settings for Security and Speed

# Core
Options -Indexes -MultiViews +FollowSymLinks
AddDefaultCharset utf-8
ServerSignature off
FileETag none

# It needs to be included at least once in order for mod_rewrite to operate
<IfModule mod_rewrite.c>
RewriteEngine on

# Redirect http to https, www to non-www, ip to domain
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^outlookenglish\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

# Cache static assets for 10 days
<FilesMatch "\.(ico|jpg|jpeg|png|gif|css|js)$">
Header set Cache-Control "max-age=864000, public"

# Cache jQuery for 100 days
<Files "jquery.js">
Header set Cache-Control "max-age=8640000, public"

# Don't cache dynamic assets
<FilesMatch "\.(php)$">
Header set Cache-Control "max-age=0, private"