Wrong redirected URL when installing new WordPress bedrock 1.13.0
- [x] I've read the guidelines for Contributing to Roots Projects
- [x] This request isn't a duplicate of an existing issue
- [x] I've read the docs and followed them (if applicable)
- [x] This is not a personal support request that should be posted on the Roots Discourse community
Description
When installing new WordPress with latest Bedrock version 1.13.0, the redirected URL to installation page is wrong, which is http://domain/WP_HOME/wp/wp-admin/install.php

If I change the URL to the right one which is http://domain/wp/wp-admin/install.php, all assets such as JS or CSS files' URLs are wrong.

Steps to reproduce
- Clone bedrock from github
- Run composer install
- Access the bedrock to install new WordPress/BedRock instance
Expected behavior: Redirected to domain/wp/wp-admin/install.php
Actual behavior: Redirected to domain/WP_HOME/wp/wp-admin/install.php
Reproduces how often: 100%
Versions
You can get this information from referencing CHANGELOG.md. Also, please include the OS and what version of the OS you're running.
BedRock 1.13.0
Additional information
I believe that the behavior is from phpdotenv v4 because I have tried to upgrade to this version before, but it went crazy and I could not handle it.
Not seeing this with this testbed: https://github.com/austinpray/bedrock-testbed/tree/br-493 (the current bedrock master is checked into the repo at this branch)
How exactly are you running this locally?
Ah never mind I can reproduce this by using the .env.example provided in the repo

https://github.com/austinpray/bedrock-testbed/tree/br-493-reproduced
It's obviously an issue with WP_SITEURL='${WP_HOME}/wp'. '${WP_HOME}/wp' is not interpolated.
@nhanledev see if this fixes your issue https://github.com/roots/bedrock/pull/494, it does for me
https://github.com/vlucas/phpdotenv/blob/92c402dad814531e4fd0469cf867302ef1f59b47/UPGRADING.md#v3-to-v4
The behaviour when parsing single quoted strings has now changed, to mimic the behaviour of bash. It is no longer possible to escape characters in single quoted strings, and everything is treated literally. As soon as the first single quote character is read, after the initial one, then the variable is treated as ending immediately at that point. When parsing unquoted or double quoted strings, it is now possible to escape dollar signs, to forcefully avoid variable interpolation. Escaping dollars is not mandated, in the sense that if a dollar is present, and not following by variable interpolation sytnax, this is allowed, and the dollar will be treated as a literal dollar. Finally, interpolation of variables is now performed right to left, instead of left to right, so it is possible to nest interpolations to allow using the value of a variable as the name of another for further interpolation.
@austinpray I can confirm that changing from a single quote to double-quote of WP_SITEURL in .env file fixes this issue.
Sweet! Tagged a bugfix release https://github.com/roots/bedrock/releases/tag/1.13.1
On Azure Web Apps this issue persists, this is because the environment variables are defined in the "Application Settings", so there is no way to add single qoutes or double qoutes.
so my only option was just to write the full domain twice, like WP_HOME=http://example.test and WP_SITEURL=http://example.test/wp
Also, for some reason the Azure web app does not like the salt keys to have curly brackets and other symbols, so i wrote them with only numbers and letters and few symbols .