doujiku1028
2017-11-21 12:55
浏览 46
已采纳

如何将404页面重定向到magento中的主页

I am trying to redirect 404 page to home page in magento 1.9.

From admin config->web I can set in 'cms no page' to 'Home Page' option and it is redirecting properly.

Like, 'www.example.com/abcv' which is 404 page, this redirecting to home page but in browser url is not changing.

I have tried .htaccess to ,

ErrorDocument 404 /index.php

but its not working,

ANy suggestion would be great.

图片转代码服务由CSDN问答提供 功能建议

我正在尝试将404页面重定向到magento 1.9中的主页。

来自admin config-> web我可以将'cms no page'设置为'Home Page'选项,它正确地重定向。

Like,'www.example.com/abcv '这是404页面,这个重定向到主页但在浏览器网址中没有变化。

我已经尝试过.htaccess了,

ErrorDocument 404 /index.php

nn

但它不起作用,

任何建议都会很棒。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • douyuan3842 2017-11-21 13:48
    已采纳

    if the query string is not changing then it is not a redirect.

    To solve your Issue without backend programming you could create custom 404 cms page and put javascript redirect in it.

    <script type="text/javascript">
    function redirectHome() {
      window.location = "{{store url=''}}";
    }
    setTimeout("redirectHome()", 5000);
    </script>
    

    otherwise you will have to write a module and add a custom frontend router

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • dqz84361326 2017-12-08 11:57

    Please see 404-Error-To-Home Page-Redirection.pngenter image description here

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题