Score:0

Cannot set path alias to "/"

cn flag

I have a weird use case where I need to specifically set the path alias of my home page to "/".

I am creating a Gatsby site and the pages are auto generated based completely off of the Drupal path alias. So If I have a path alias of "/about", the /about page will get generated in Gatsby.

The problem is that for my home page, I cannot set the path alias to just "/" in Drupal. If I try doing that on the actual node edit page, it gets stripped out on save and becomes null. Same thing if I try to go the URL aliases admin page and try to manually set it there for my node page. If I try to just put "/", it gets stripped out there also.

I am successfully able to add that path alias as my "Default front page" in "System > Basic site settings". If I add it there it does not get wiped out on save, however now my home page just becomes a 404 page because it cannot find a page with a path alias of "/". I know this is possible to do somehow because the Drupal/Gatsby youTube tutorial I was following is doing this and it shows the Drupal admin with a path alias of just / for his homepage. I contacted that developer and he said he doesn't remember how he was able to get that to happen and doesn't remember needing to do anything specific to allow for that.

I am using Docksal for my local site and I also have a Pantheon site running the same codebase and database and I can't set it in either of those sites. I am running the latest version of D9 (9.3.9). Can anyone think of a reason I cannot do this? I'm wondering if I need to create a custom module to make this happen or something? Or if I just need to apply some kind of Drupal core patch?

sonfd avatar
in flag
I’m voting to close this question because it's a [known issue](https://www.drupal.org/project/drupal/issues/3100350) in the d.o issue queue.
Score:1
cn flag

I found a patch for Drupal core that seems to have worked. It was #14 here:

https://www.drupal.org/project/drupal/issues/3100350

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.