Get all URLs from a multisite installation I have an multisite installation like this:


www.example.com/animal
www.example.uk/animal


Each site has a configuration like so:

'example.com' =&gt; array(
        'siteUrl' =&gt; array(
            'us_en' =&gt; 'https://www.example.com/'
        )
'example.uk' =&gt; array(
        'siteUrl' =&gt; array(
            'uk_en' =&gt; 'https://www.example.uk/'
        ).


I want to print a collection of URLs from all of the locales. For example:


www.example.com/animal
www.example.uk/animal


And check their status as well.
I don't know what version of Craft you're using, but recently it became possible to request multiple site's version of the same entry/entries. For this to work, you need to provide multiple site ID's to the siteId part of the query, or multiple handles to the site part of the query:

{#
 # Provide the entry element query with the IDs for 3 sites
 # and group those by the entry's ID, so we know which entries belong together
 #}
{% set entriesById = craft.entries.siteId([1,2,3]).all() |group('id') %}

{#
 # Loop through the grouped entries and display whatever you need to display.
 # Each entry has their own `siteId` set, so you can use .getUrl() (or .url) to display the url
 #} 
{% for entryId, entries in entriesById %}
    &lt;h2&gt;Entry {{ entryId }}&lt;/h2&gt;

    {% for entry in entries %}
        URL: {{ entry.url }} - Status: {{ entry.status }}  
    {% endfor %}
{% endfor %}


If you are using Craft 2 (or a Craft 3 version before it became possible to query multiple site's entry versions at once), I think you could do it like this:

{# Craft 2 (untested, it's been a while ... #}
{% for locale in craft.i18n.getSiteLocales() %}
    {% set entry = craft.entries.id([your entry's id]).locale(locale) %}

    {% if entry %}
        URL: {{ entry.url }} - Status: {{ entry.status }}
    {% endif %}
{% endfor %}

{# Craft 3, before my original answer became possible #}
{% for site in craft.app.sites.allSites %}
    {% set entry = craft.entries.id([your entry's ID]).siteId(site.id).one() %}

    {% if entry %}
        URL: {{ entry.url }} - Status: {{ entry.status }}
    {% endif %}
{% endfor %}