mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge branch 'removestatic' of git://github.com/wilr/silverstripe-cms into wilr-removestatic
This commit is contained in:
commit
d229fdcc6d
@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a system-generated PHP script that performs header management for the statically cached content given below.
|
|
||||||
*/
|
|
||||||
|
|
||||||
define('MAX_AGE', '**MAX_AGE**');
|
|
||||||
define('LAST_MODIFIED', '**LAST_MODIFIED**');
|
|
||||||
|
|
||||||
if(MAX_AGE > 0) {
|
|
||||||
header("Cache-Control: max-age=" . MAX_AGE);
|
|
||||||
header("Pragma:");
|
|
||||||
} else {
|
|
||||||
header("Cache-Control: no-cache, max-age=0, must-revalidate");
|
|
||||||
}
|
|
||||||
|
|
||||||
header("Expires: " . gmdate('D, d M Y H:i:s', time() + MAX_AGE) . ' GMT');
|
|
||||||
header("Last-modified: " . gmdate('D, d M Y H:i:s', strtotime(LAST_MODIFIED)) . ' GMT');
|
|
||||||
|
|
||||||
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
|
|
||||||
if(strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= strtotime(LAST_MODIFIED)) {
|
|
||||||
header("Last-modified: " . gmdate('D, d M Y H:i:s', strtotime(LAST_MODIFIED)) . ' GMT', true, 304);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
**CONTENT**
|
|
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a system-generated PHP script that performs header management for a 301 redirection.
|
|
||||||
*/
|
|
||||||
|
|
||||||
define('DESTINATION', '**DESTINATION**');
|
|
||||||
define('MAX_AGE', 3600);
|
|
||||||
|
|
||||||
if(MAX_AGE > 0) {
|
|
||||||
header("Cache-Control: max-age=" . MAX_AGE);
|
|
||||||
header("Pragma:");
|
|
||||||
} else {
|
|
||||||
header("Cache-Control: no-cache, max-age=0, must-revalidate");
|
|
||||||
}
|
|
||||||
|
|
||||||
header("Expires: " . gmdate('D, d M Y H:i:s', time() + MAX_AGE) . ' GMT');
|
|
||||||
header("Location: " . DESTINATION, true, 301);
|
|
||||||
|
|
||||||
?>
|
|
@ -1,39 +0,0 @@
|
|||||||
### 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]
|
|
@ -1,48 +0,0 @@
|
|||||||
### 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 ###
|
|
@ -1,39 +0,0 @@
|
|||||||
### 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.php -f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteRule .* /**sitedir**/cache/%1.php [L]
|
|
||||||
|
|
||||||
# Cached content - homepage
|
|
||||||
RewriteCond %{REQUEST_METHOD} ^GET$
|
|
||||||
RewriteCond %{QUERY_STRING} ^$
|
|
||||||
RewriteCond %{REQUEST_URI} ^/**sitedir**/?$
|
|
||||||
RewriteCond /**sitedir**/cache/index.php -f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteRule .* /**sitedir**/cache/index.php [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.php -f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteRule .* /cache/%1.php [L]
|
|
||||||
|
|
||||||
# Cached content - homepage
|
|
||||||
RewriteCond %{REQUEST_METHOD} ^GET$
|
|
||||||
RewriteCond %{QUERY_STRING} ^$
|
|
||||||
RewriteCond %{REQUEST_URI} ^/?$
|
|
||||||
RewriteCond %{DOCUMENT_ROOT}/cache/index.php -f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteRule .* /cache/index.php [L]
|
|
Loading…
Reference in New Issue
Block a user