diff --git a/.htaccess b/.htaccess index 5cbd1e8..597a7f4 100644 --- a/.htaccess +++ b/.htaccess @@ -10,10 +10,11 @@ Deny from all - - RewriteEngine On - RewriteCond %{REQUEST_URI} ^(.*)$ - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] - +RewriteEngine On +RewriteBase / + + +RewriteCond %{REQUEST_URI} ^(.*)$ +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule .* sapphire/static-main.php?url=%1&%{QUERY_STRING} [L] ### SILVERSTRIPE END ### diff --git a/mysite/_config.php b/mysite/_config.php index d117789..5e4b0f0 100644 --- a/mysite/_config.php +++ b/mysite/_config.php @@ -4,7 +4,7 @@ global $project; $project = 'mysite'; global $database; -$database = ""; +$database = "SS_mysite_24_test"; require_once("conf/ConfigureFromEnv.php"); @@ -16,3 +16,5 @@ SSViewer::set_theme('blackcandy'); // enable nested URLs for this site (e.g. page/sub-page/) SiteTree::enable_nested_urls(); + +Object::add_extension("SiteTree", "FilesystemPublisher('cache/', 'php')"); \ No newline at end of file diff --git a/mysite/code/Page.php b/mysite/code/Page.php index 7d9d708..c24c4b8 100755 --- a/mysite/code/Page.php +++ b/mysite/code/Page.php @@ -8,6 +8,13 @@ class Page extends SiteTree { public static $has_one = array( ); + function allPagesToCache() { + $pages = DataObject::get('Page'); + $urls = array(); + foreach($pages as $page) $urls[] = $page->AbsoluteLink(); + return $urls; + } + } class Page_Controller extends ContentController {