<?php
$path = dirname(__FILE__).'/';
define('MODX_SITE_BASE_URL', '/');
define('MODX_SITE_URL', (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off' ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].MODX_SITE_BASE_URL);
$modx_baseurl = MODX_SITE_BASE_URL;
include_once($path.'modxapi.php'); //last release of Modx API file located in the root
$modx = new MODxAPI();
$modx->connect();
$modx->getSettings();
//$modx->startSession();
// Set the base URL for any MODx snippets
$modx->config['base_url'] = MODX_SITE_BASE_URL;
//Run snippet
$modx->runSnippet('snippetname');
?>