我有一个人谁希望我发送或重定向所有404个错误到网站的主页。我们使用的是Drupal7.54。在站点信息页面(.../admin/config/system/ site - information )的“错误页面”块中,它允许我为“默认403 (拒绝访问)页面”和“默认404 (未找到)页面”放置一个链接。我刚试着在404上输入"node“,这样它就会重定向到网站的主页。但是,这不会将我重定向到主页。它确实会重定向,但不会重定向到主页。我做错了什么?我遗漏了什么?答案可能在includes/common.inc中的某个地方(类似于在上找到的内容)吗?任何帮助都将不胜感激。谢谢。
下面有处理404错误的代码,但是我喜欢将所有404错误重定向到主页,下面是我所拥有的:
function show_404($page = '', $log_error = TRUE)
{
$heading = "404 Page Not Found";
$message = "The page you requested was not found.";
// By default we log this, but allow a dev to skip it
if ($log_error)
{
在我的Vue应用程序中,用户的主页取决于他们的角色。为了确保向用户显示正确的主页,我使用以下导航保护:
export default (to, from, next) => {
const authService = getAuthService()
if (to.path === '/') {
// if they've requested the home page, send them to
// different pages depending on their role
if (authService.isUser(