SELECT site.*, site.cd_site, site.cd_site_pai, site.ds_site, site.id_site_nivel, site.id_site_menu, site.id_site_tipo, site.cd_site_url_matia, site.cd_site_url_capa, REPLACE(REPLACE(REPLACE(site.cd_site_url_capa, '/index.php', ''), '?id=', ''), 'index.php', '') as cd_site_url_capa_short, site.ds_site_path FROM site WHERE site.cd_site > 0 AND site.cd_poral = 1 ORDER BY site.id_site_nivel, site.id_site_posme, site.ds_site_arvor