-
-
Save technoweenie/66722 to your computer and use it in GitHub Desktop.
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
# If cached file exists, serve it and stop processing | |
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f | |
RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [L] | |
# other redirection (imgs, js, css, ...) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !.*/mephisto/.* | |
RewriteCond %{REQUEST_URI} !.*html | |
RewriteCond %{REQUEST_URI} !^/cache | |
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/$1 -f | |
RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}/$1 [QSA,L] | |
# nginx! | |
if (-f $document_root/cache/$host$uri/index.html) { | |
rewrite (.*) /cache/$host$1/index.html break; | |
} | |
if (-f $document_root/cache/$host$uri.html) { | |
rewrite (.*) /cache/$host$1.html break; | |
} | |
if (-f $document_root/cache/$host$uri) { | |
rewrite (.*) /cache/$host$1 break; | |
} | |
location ~ ^/assets/\d+/ { | |
rewrite ^/assets/(\d+)/(.+)$ /assets/$host/$1/$2 last; | |
} | |
location /assets {} | |
location /cache {} | |
location /plugins {} | |
location ~ ^/(images|javascripts|stylesheets)/mephisto {} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment