diff --git a/_config.php b/_config.php index 9a0dcb8d2..b2175384c 100644 --- a/_config.php +++ b/_config.php @@ -73,4 +73,21 @@ Security::set_password_encryption_algorithm('sha1', true); define('EMAIL_BOUNCEHANDLER_KEY', '1aaaf8fb60ea253dbf6efa71baaacbb3'); +// Default director +Director::addRules(10, array( + 'Security/$Action/$ID' => 'Security', + 'db/$Action' => 'DatabaseAdmin', + '$Controller/$Action/$ID/$OtherID' => '*', + 'images/$Action/$Class/$ID/$Field' => 'Image_Uploader', + '' => 'RootURLController', + 'sitemap.xml' => 'GoogleSitemap', + 'api/v1/$ClassName/$ID' => 'RestfulServer', + 'dev/$Action/$NestedAction' => 'DevelopmentAdmin' +)); + +Director::addRules(1, array( + '$URLSegment/$Action/$ID/$OtherID' => 'ModelAsController', +)); + + ?> \ No newline at end of file diff --git a/main.php b/main.php index 0849d5ba0..2d2d88389 100644 --- a/main.php +++ b/main.php @@ -120,22 +120,6 @@ if(isset($_GET['debug_profile'])) Profiler::mark('all_execution'); if(isset($_GET['debug_profile'])) Profiler::mark('main.php init'); -// Default director -Director::addRules(10, array( - 'Security/$Action/$ID' => 'Security', - 'db/$Action' => 'DatabaseAdmin', - '$Controller/$Action/$ID/$OtherID' => '*', - 'images/$Action/$Class/$ID/$Field' => 'Image_Uploader', - '' => 'RootURLController', - 'sitemap.xml' => 'GoogleSitemap', - 'api/v1/$ClassName/$ID' => 'RestfulServer', - 'dev/$Action/$NestedAction' => 'DevelopmentAdmin' -)); - -Director::addRules(1, array( - '$URLSegment/$Action/$ID/$OtherID' => 'ModelAsController', -)); - // Load error handlers Debug::loadErrorHandlers();