If you set the Base URL of a site to an alias, it will properly set that alias in the Project Config files.

But when you "Rebuild the Config", it will actually change it to the _value_ of the alias.

baseUrldefault--***.yamlNot able to reproduce this, and not sure how it could happen. Sites’ configs are rebuild from craft\models\Site::getConfig(), which returns the current $baseUrl value:
Craft never stores the parsed base URL there – that only happens from getBaseUrl():
Maybe something in a module/plugin is overwriting the $baseUrl property with the parsed URL?
Weirdly, this trick doesn't seem to be working for me either...
https://github.com/craftcms/cms/issues/5106#issuecomment-708718343
Can you reproduce that one? If not, i can nuke my whole vendor folder and try again.
For what it's worth, I've noticed something similar with a project updating from Craft 2 to 3. When doing the upgrade on the DB, we throw out the upgraded project config values (in favor of the ones we've been working on for Craft 3), but Craft seem to _really_ want us to use the URL string rather than an environment variable.
Next time we run the process I'll see if I can narrow down the issue to anything more specific.
@lindseydiloreto 'disabledPlugins' => '*' is still working for me.
Ah, my bad! I was doing it wrong, setting it as an array syntax (['*'] instead of just '*'). 🤦
Ok, I have:
And I still get the same issue when I click the "Rebuild the Config" button...


It's worth noting that the baseUrl gets written to PC normally when you simply edit that field directly.

After I re-save the field normally, it corrects the PC mistake.
And even now, after saving the site from the CP with @baseUrl, if you rebuild the project config, it will go back to http://industrialassets.test ?
If I save the field normally (as if I were editing it), the PC value is set to @baseUrl.
If I rebuild it (via "Rebuild the Config"), the PC value changes to http://industrialassets.test.
Alright, well I’m a bit stumped. If you can send in your Composer files, a database backup, and any custom module files, etc., we can try to reproduce it locally using those. [email protected]
You got it, thanks! I'll send that stuff over. 👍
We ended up tracking this down to the siteUrl config setting. Same issue could occur with the siteName config setting as well. I’ve fixed this for the next release.
Ok sweet, thanks @brandonkelly! 🍺
Worth mentioning here that I’ve just deprecated the siteUrl config setting for Craft 3.6 (see #3205). So while this bug will be fixed in the next release, you’re best off moving away from that config setting to begin with, and setting your sites’ Base URL settings using aliases or environment variables instead.
Craft 3.5.17 is out now with this fix.
Brilliant, thanks dude! 👍
Most helpful comment
Worth mentioning here that I’ve just deprecated the
siteUrlconfig setting for Craft 3.6 (see #3205). So while this bug will be fixed in the next release, you’re best off moving away from that config setting to begin with, and setting your sites’ Base URL settings using aliases or environment variables instead.