Score:0

Is there a way to redirect any 404 to the homepage?

my flag

I understand that Drupal doesn't have a core module to handle redirects and that's normally done by the Redirect module, or from the webserver.

But if I want to redirect any 404 to the homepage, due to say, a very content-varied site in which it's unlikely to find articles on the same topic, can this be done with Drupal core without editing webserver file?

4uk4 avatar
cn flag
This is bad practice, see https://stackoverflow.com/questions/6189169/redirect-to-404-page-or-display-404-message. So don't redirect, instead configure a default not found page as answered by Patrick Kenny. In case you configure the homepage you might want to add a block only visible on the 404 page explaining what is going on: https://www.drupal.org/project/block_in_page_not_found
Score:1
cn flag

Under Admin -> Config -> Basic site settings, you can set the Default 404 (not found) page.

URL path: /admin/config/system/site-information

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.