0

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?

1
  • 1
    I’m voting to close this question because it's a known issue in the d.o issue queue.
    – sonfd
    Commented Mar 24, 2022 at 13:22

1 Answer 1

1

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

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.