mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
### SILVERSTRIPE START ###
|
|
RewriteEngine On
|
|
|
|
## CONFIG FOR DEV ENVIRONMENTS
|
|
|
|
# Cached content - **sitedir** subdirectory
|
|
RewriteCond %{REQUEST_METHOD} ^GET$
|
|
RewriteCond %{QUERY_STRING} ^$
|
|
RewriteCond %{REQUEST_URI} ^/**sitedir**/(.*)$
|
|
RewriteCond %{REQUEST_URI} /**sitedir**/(.*[^/])/?$
|
|
RewriteCond %{DOCUMENT_ROOT}/**sitedir**/cache/%1.html -f
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteRule .* /**sitedir**/cache/%1.html [L]
|
|
|
|
# Cached content - homepage
|
|
RewriteCond %{REQUEST_METHOD} ^GET$
|
|
RewriteCond %{QUERY_STRING} ^$
|
|
RewriteCond %{REQUEST_URI} ^/**sitedir**/?$
|
|
RewriteCond /**sitedir**/cache/index.html -f
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteRule .* /**sitedir**/cache/index.html [L]
|
|
|
|
## CONFIG FOR TEST/LIVE ENVIRONMENTS
|
|
|
|
# Cached content - live webserver
|
|
RewriteCond %{REQUEST_METHOD} ^GET$
|
|
RewriteCond %{QUERY_STRING} ^$
|
|
RewriteCond %{REQUEST_URI} /(.*[^/])/?$
|
|
RewriteCond %{DOCUMENT_ROOT}/cache/%1.html -f
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteRule .* /cache/%1.html [L]
|
|
|
|
# Cached content - homepage
|
|
RewriteCond %{REQUEST_METHOD} ^GET$
|
|
RewriteCond %{QUERY_STRING} ^$
|
|
RewriteCond %{REQUEST_URI} ^/?$
|
|
RewriteCond %{DOCUMENT_ROOT}/cache/index.html -f
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteRule .* /cache/index.html [L]
|
|
|
|
## DYNAMIC CONFIG
|
|
|
|
# Dynamic content
|
|
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
|
|
RewriteCond %{REQUEST_URI} ^(.*)$
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]
|
|
### SILVERSTRIPE END ###
|