TransWikia.com

Why is $DEFAULT_SITE_URL appearing in entries URL?

Craft CMS Asked on April 11, 2021

I have an entry loop on my homepage that uses {{ entry.url }} that links to the full entry. When I click on the entry, the url looks like this

mydomain.com/$DEFAULT_SITE_URL/the-entrys-slug

Even though my section settings just has the Entry URI Format set to {slug}

Here’s my entry loop if you need it

{% set aBetterPost = craft.entries.section('aBetterPost').limit('6').all() %}
{% for entry in aBetterPost %}
    <div class="main-post">
        <a href="{{ entry.url }}">
            Entry Stuff...
        </a>
    </div>
{% endfor %}

How can I get rid of the $DEFAULT_SITE_URL ?

One Answer

You probably have a misconfiguration in your environment variables - First go to the control panel and check what you have under Settings > Sites > [choose site] > Base URL. If it's set to an env variable (i.e. it begins with a dollar sign), go to wherever you store your environment variables (e.g. the .env file, or maybe server env vars if you're on the remote), and check that you have a variable there with the expected value.

Correct answer by James Smith on April 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP