Okay, looks like I fixed it through editing the
create_image_sitemap.php file, changing this part...
// define SITE_URL constant with http or https
function get_site_url() {
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) && stripos($_SERVER['SERVER_PROTOCOL'], 'https') === 0) ||
(isset($_SERVER['REQUEST_SCHEME']) && stripos($_SERVER['REQUEST_SCHEME'], 'https') === 0) ||
(isset($_SERVER['HTTPS']) && in_array($_SERVER['HTTPS'], ['on', 1])) ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) ? 'https' : 'http';
return $protocol . '://' . $_SERVER['HTTP_HOST'] . substr(dirname(__DIR__), strlen($_SERVER['DOCUMENT_ROOT']));
}
define('SITE_URL', get_site_url());
to this...
// define SITE_URL constant with http or https
function get_site_url() {
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) && stripos($_SERVER['SERVER_PROTOCOL'], 'https') === 0) ||
(isset($_SERVER['REQUEST_SCHEME']) && stripos($_SERVER['REQUEST_SCHEME'], 'https') === 0) ||
(isset($_SERVER['HTTPS']) && in_array($_SERVER['HTTPS'], ['on', 1])) ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) ? 'https' : 'http';
$doc_root = rtrim(realpath($_SERVER['DOCUMENT_ROOT']), DIRECTORY_SEPARATOR);
$dir = rtrim(realpath(dirname(__DIR__)), DIRECTORY_SEPARATOR);
$path = '/' . ltrim(str_replace($doc_root, '', $dir), '/');
return $protocol . '://' . $_SERVER['HTTP_HOST'] . $path;
}
define('SITE_URL', get_site_url());
This should work for both X3 gallery being installed in a subdirectory or in the root folder.
Might this be worth an update of your original code or was my issue just caused by silly me not finding any option to set the base url or something like that? :D If it's the latter, kindly let me know please. :)