bdolly/paperTheme/master/.htaccess
# BEGIN WordPress
# END WordPress
#### TURN ON PHP ERROR LOGGING
php_flag log_errors on
php_flag display_errors off
# php_value error_log /path_to_wp_root/errors/php_error.log
php_value error_reporting -1
########################################################
# Modifications based on recommendations from Smashing Magazine
# http://www.smashingmagazine.com/2014/06/25/how-to-speed-up-your-wordpress-website/
########################################################
<IfModule mod_rewrite.c>
#### BLOCK CONTENT SCRAPERS AND HOT LINKS
#(http://www.smashingmagazine.com/2010/07/01/10-useful-wordpress-security-tweaks/)
# Replace ?mysite.com/ with your blog url
#RewriteCond %{HTTP_REFERER} !^http://(.+.)?mysite.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
# Replace /images/nohotlink.jpg with your "don't hotlink" image url
#RewriteRule .*.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]
#### BLOCK SCRIPT INJECTIONS
#(http://www.smashingmagazine.com/2010/07/01/10-useful-wordpress-security-tweaks/)
Options +FollowSymLinks
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
</IfModule>
<IfModule mod_deflate.c>
#### GZIP COMPRESSION
# (http://www.smashingmagazine.com/2014/06/25/how-to-speed-up-your-wordpress-website/)
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/js
AddOutputFilterByType DEFLATE text/.min.css
AddOutputFilterByType DEFLATE text/svg
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Insert filter
SetOutputFilter DEFLATE
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
#### BROWSER CACHING (http://www.smashingmagazine.com/2014/06/25/how-to-speed-up-your-wordpress-website/)
# associate .js with “text/javascript” type (if not present in mime.conf)
AddType text/javascript .js
#### CONFIGURE mod_expires
#(http://httpd.apache.org/docs/2.2/mod/mod_expires.html)
ExpiresActive On
ExpiresDefault "access plus 1 second"
ExpiresByType image/x-icon "access plus 2692000 seconds"
ExpiresByType image/jpeg "access plus 2692000 seconds"
ExpiresByType image/png "access plus 2692000 seconds"
ExpiresByType image/gif "access plus 2692000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2692000 seconds"
ExpiresByType text/css "access plus 2692000 seconds"
ExpiresByType text/javascript "access plus 2692000 seconds"
ExpiresByType applicaiton/x-javascript "access plus 2692000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType appliaction/xhtml+xml "access plus 600 seconds"
# CONFIGURE mod_headers
# URL: http://httpd.apache.org/docs/2.2/mod/mod_headers.html
<FilesMatch ".(ico|flv|jpg|jpeg|png|gif|swf|mpeg|wav|mp3|wma|mpg|css|js)$">
Header set Cache-Control "max-age=2692000, public"
</FilesMatch>
<FilesMatch ".(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</FilesMatch>
Header unset ETag
Header unset Last-Modified
Header set Connection keep-alive
On Github License
Files
Download PDF of Htaccess file