Created
February 3, 2010 19:31
-
-
Save skojin/293929 to your computer and use it in GitHub Desktop.
apache rewrite rules for rails cache_page in /public/cache directory
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
RewriteEngine On | |
# home page cache | |
RewriteCond %{THE_REQUEST} ^(GET|HEAD) | |
RewriteCond %{QUERY_STRING} ^$ | |
RewriteCond %{REQUEST_URI} ^/([^.]+)$ | |
RewriteCond %{DOCUMENT_ROOT}/cache/%1.html -f | |
RewriteRule ^/[^.]+$ /cache/%1.html [QSA,L] | |
# general pages cache | |
RewriteCond %{THE_REQUEST} ^(GET|HEAD) | |
RewriteCond %{QUERY_STRING} ^$ | |
RewriteCond %{DOCUMENT_ROOT}/cache/index.html -f | |
RewriteRule ^/$ /cache/index.html [QSA,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment