Advertisement
flotschi

Untitled

Jun 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. RewriteEngine On
  2.  
  3. # Rewrite to html cache if it exists and the request is off a static page (no url query params and only get requests)
  4. RewriteCond %{REQUEST_METHOD} GET
  5. RewriteCond %{QUERY_STRING} !.*=.*
  6. RewriteCond %{DOCUMENT_ROOT}/cache/static%{REQUEST_URI}.html -f
  7. RewriteRule ^(.*)$ /cache/static%{REQUEST_URI}.html [L]
  8.  
  9. # This is specific to cache the index when it' accesed vie /
  10. RewriteCond %{REQUEST_METHOD} GET
  11. RewriteCond %{QUERY_STRING} !.*=.*
  12. RewriteCond %{DOCUMENT_ROOT}/cache/static/index.html -f
  13. RewriteCond %{REQUEST_URI} ^/$
  14. RewriteRule .* /cache/static/index.html [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement