Created
May 2, 2017 19:23
-
-
Save ginocremer/64b285fb79aeba49230dcf8ad0777a81 to your computer and use it in GitHub Desktop.
Cachify Snippet / .htaccess if WordPress is in a subdirectory/subfolder (e.g. "wordpress")
This file contains 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
<IfModule mod_rewrite.c> | |
# ENGINE ON | |
RewriteEngine On | |
# GZIP FILE | |
<IfModule mod_mime.c> | |
RewriteCond %{REQUEST_URI} /$ | |
RewriteCond %{REQUEST_URI} !^/wp-admin/.* | |
RewriteCond %{REQUEST_METHOD} !=POST | |
RewriteCond %{QUERY_STRING} ="" | |
RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_ | |
RewriteCond %{HTTP:Accept-Encoding} gzip | |
RewriteCond %{DOCUMENT_ROOT}/wordpress/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}/index.html.gz -f | |
RewriteRule ^(.*) /wordpress/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz [L] | |
AddType text/html .gz | |
AddEncoding gzip .gz | |
</IfModule> | |
# HTML FILE | |
RewriteCond %{REQUEST_URI} /$ | |
RewriteCond %{REQUEST_URI} !^/wp-admin/.* | |
RewriteCond %{REQUEST_METHOD} !=POST | |
RewriteCond %{QUERY_STRING} ="" | |
RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_ | |
RewriteCond %{DOCUMENT_ROOT}/wordpress/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}/index.html -f | |
RewriteRule ^(.*) /wordpress/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html [L] | |
</IfModule> | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment