Skip to content

Instantly share code, notes, and snippets.

@robbiegod
Created November 23, 2015 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robbiegod/f2fe56e325ad822c2357 to your computer and use it in GitHub Desktop.
Save robbiegod/f2fe56e325ad822c2357 to your computer and use it in GitHub Desktop.
Wordpress .htaccess starter file for Rackspace Cloud Sites (possibly others)
# 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
# Credits
# http://www.sysadminworld.com/2012/enable-gzip-compression-for-rackspace-cloud-sites/
<IfModule mod_deflate.c>
# 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>
# Credit: http://checkgzipcompression.com/ - test if gzip is enabled.
# Credit: W3 Total Cache - http://www.rackspace.com/knowledge_center/article/configure-w3-total-cache-for-wordpress-with-rackspace-cloud-files-cdn
# May want to install a cache plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment