Created
October 8, 2012 10:02
-
-
Save jtallant/3851775 to your computer and use it in GitHub Desktop.
Example WordPress .htaccess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # BEGIN mod headers | |
| <IfModule mod_headers.c> | |
| Header set Connection keep-alive | |
| </IfModule> | |
| # END mod headers | |
| # BEGIN compress text, html, javascript, css, xml: | |
| <IfModule mod_deflate.c> | |
| AddOutputFilterByType DEFLATE text/plain | |
| AddOutputFilterByType DEFLATE text/html | |
| AddOutputFilterByType DEFLATE text/xml | |
| AddOutputFilterByType DEFLATE text/css | |
| AddOutputFilterByType DEFLATE application/xml | |
| AddOutputFilterByType DEFLATE application/xhtml+xml | |
| AddOutputFilterByType DEFLATE application/rss+xml | |
| AddOutputFilterByType DEFLATE application/javascript | |
| AddOutputFilterByType DEFLATE application/x-javascript | |
| </IfModule> | |
| # END compress text, html, javascript, css, xml: | |
| # BEGIN set expires headers | |
| <IfModule mod_expires.c> | |
| ExpiresActive on | |
| ExpiresDefault "access plus 1 month" | |
| # Favicon (cannot be renamed) | |
| AddType image/vnd.microsoft.icon .ico | |
| ExpiresByType image/x-icon "access plus 3 months" | |
| ExpiresByType image/vnd.microsoft.icon "access plus 3 months" | |
| # HTML | |
| ExpiresByType text/html "access plus 1 day" | |
| # Media: images, video, audio | |
| ExpiresByType image/gif "access plus 1 month" | |
| ExpiresByType image/png "access plus 1 month" | |
| ExpiresByType image/jpg "access plus 1 month" | |
| ExpiresByType image/jpeg "access plus 1 month" | |
| ExpiresByType video/ogg "access plus 1 month" | |
| ExpiresByType audio/ogg "access plus 1 month" | |
| ExpiresByType video/mp4 "access plus 1 month" | |
| ExpiresByType video/webm "access plus 1 month" | |
| # Webfonts | |
| ExpiresByType font/truetype "access plus 1 month" | |
| ExpiresByType font/opentype "access plus 1 month" | |
| ExpiresByType application/x-font-woff "access plus 1 month" | |
| ExpiresByType image/svg+xml "access plus 1 month" | |
| ExpiresByType application/vnd.ms-fontobject "access plus 1 month" | |
| # CSS and JavaScript | |
| ExpiresByType text/css "access plus 1 year" | |
| ExpiresByType application/javascript "access plus 1 year" | |
| ExpiresByType text/javascript "access plus 1 year" | |
| </IfModule> | |
| # END set expires headers | |
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule . /index.php [L] | |
| </IfModule> | |
| # END WordPress | |
| # Block IP addresses | |
| order allow,deny | |
| deny from 46.185.33.55 | |
| allow from all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment