<![CDATA[ Problem moving site to localhost - My Forums]]> https://forums.modx.com/thread/?thread=104361 <![CDATA[Problem moving site to localhost]]> https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561339 I have made a copy of a modx site on my local server (xampp installed) for convenience when working with tests.

Everything seems to work fine after config.core and config.inc modifications, except the urls of the gallery images. The problem is with the slash that precedes the url of the images.

For example:
on the uploaded site:
with
<base href = "https://mydomain.com/">

this works:
<img src = "/ assets / images / myimage.jpg" />

And this too:
<img src = "assets / images / myimage.jpg" />


But in my local site
with
<base href = "http://localhost/mysite/">

this don't work:
<img src = "/ assets / images / myimage.jpg" />

but this yes:
<img src = " assets / images / myimage.jpg" />


I suppose this is due to some apache configuration, but...

some idea?


Thanks!]]>
abramco Sep 03, 2018, 04:15 PM https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561339
<![CDATA[Re: Problem moving site to localhost]]> https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561367 Quote from: andytough at Sep 03, 2018, 05:47 PM
Is it anything to do with http vs https?

I don't think so.


I'm not an expert on apache, but I think the slash always sends to the root directory (loclahost), even if RewriteBase / mysite / is specified in the .htaccess of mysite folder.

I will try creating a virtualhost.]]>
abramco Sep 04, 2018, 03:17 PM https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561367
<![CDATA[Re: Problem moving site to localhost]]> https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561345 andytough Sep 03, 2018, 05:47 PM https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561345 <![CDATA[Re: Problem moving site to localhost]]> https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561341
define('MODX_CORE_PATH', 'F:/XAMPP/htdocs/mysite/core/');
define('MODX_CONFIG_KEY', 'config');
]]>
abramco Sep 03, 2018, 04:19 PM https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561341
<![CDATA[Re: Problem moving site to localhost]]> https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561340
if (!defined('MODX_CORE_PATH')) {
    $modx_core_path= 'F:/XAMPP/htdocs/mysite/core/';
    define('MODX_CORE_PATH', $modx_core_path);
}
if (!defined('MODX_PROCESSORS_PATH')) {
    $modx_processors_path= 'F:/XAMPP/htdocs/mysite/core/model/modx/processors/';
    define('MODX_PROCESSORS_PATH', $modx_processors_path);
}
if (!defined('MODX_CONNECTORS_PATH')) {
    $modx_connectors_path= 'F:/XAMPP/htdocs/mysite/connectors/';
    $modx_connectors_url= '/mysite/connectors/';
    define('MODX_CONNECTORS_PATH', $modx_connectors_path);
    define('MODX_CONNECTORS_URL', $modx_connectors_url);
}
if (!defined('MODX_MANAGER_PATH')) {
    $modx_manager_path= 'F:/XAMPP/htdocs/mysite/manager/';
    $modx_manager_url= '/mysite/manager/';
    define('MODX_MANAGER_PATH', $modx_manager_path);
    define('MODX_MANAGER_URL', $modx_manager_url);
}
if (!defined('MODX_BASE_PATH')) {
    $modx_base_path= 'F:/XAMPP/htdocs/mysite/';
    $modx_base_url= '/mysite/';
    define('MODX_BASE_PATH', $modx_base_path);
    define('MODX_BASE_URL', $modx_base_url);
}
if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
    $isSecureRequest = false;
} else {
    $isSecureRequest = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
}
if (!defined('MODX_URL_SCHEME')) {
    $url_scheme=  $isSecureRequest ? 'https://' : 'http://';
    define('MODX_URL_SCHEME', $url_scheme);
}
if (!defined('MODX_HTTP_HOST')) {
    if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
        $http_host='abelmartinez.net';
        define('MODX_HTTP_HOST', $http_host);
    } else {
        $http_host= array_key_exists('HTTP_HOST', $_SERVER) ? htmlspecialchars($_SERVER['HTTP_HOST'], ENT_QUOTES) : 'localhost/am';
        if ($_SERVER['SERVER_PORT'] != 80) {
            $http_host= str_replace(':' . $_SERVER['SERVER_PORT'], '', $http_host); // remove port from HTTP_HOST
        }
        $http_host .= ($_SERVER['SERVER_PORT'] == 80 || $isSecureRequest) ? '' : ':' . $_SERVER['SERVER_PORT'];
        define('MODX_HTTP_HOST', $http_host);
    }
}
if (!defined('MODX_SITE_URL')) {
    $site_url= $url_scheme . $http_host . MODX_BASE_URL;
    define('MODX_SITE_URL', $site_url);
}
if (!defined('MODX_ASSETS_PATH')) {
    $modx_assets_path= 'F:/XAMPP/htdocs/mysite/assets/';
    $modx_assets_url= '/mysite/assets/';
    define('MODX_ASSETS_PATH', $modx_assets_path);
    define('MODX_ASSETS_URL', $modx_assets_url);
}
]]>
abramco Sep 03, 2018, 04:17 PM https://forums.modx.com/thread/104361/problem-moving-site-to-localhost#dis-post-561340