1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 How to redirect 404 to homepage?

Discussion in 'XenForo Questions and Support' started by ibrian, Dec 29, 2014.

  1. ibrian

    ibrian Active Member

    I appreciate the technical need for 404 error page, but they are absolutely terrible for users and having made a site move, and finding it to be very frustrating to still have so many 404's come up.

    How would I be able to redirect visitors from the default XF 404 page to the XF homepage, please?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Why do you have so many 404's after a site move?
    Haven't you implemented redirects from the old to the new URLs?
     
  3. Tracy Perry

    Tracy Perry Well-Known Member

  4. ibrian

    ibrian Active Member

    Indeed, I ran kier's redirect script, but needed to drop that to redirect the old domain properly - it's been 5 months since I did the move.

    However, Google is still full of the old domain vb3 URLs.

    So I would rather have a 404 page that now redirects to the homepage, than have continued errors that are no good for users.
     
  5. Mr Lucky

    Mr Lucky Well-Known Member

    I think If you care about SEO, then you may find that Google is happier with a 404 as opposed to a redirect to homepage.

    But something like this in htaccess should work

    ErrorDocument 404 /index.php

    Though you may need an absolute path.

    I would also advise against it for the reason that you won't find the errors that are causing the 4o4s.
     
    ibrian likes this.
  6. Mr Lucky

    Mr Lucky Well-Known Member

    I find the best thing is to have a custom 404 page with some text explaining that the page you are looking for has gone or moved, and to include a useful site at so the person can either go to the home page or maybe find what they are looking for.
     
  7. bibitbunga

    bibitbunga Member

Share This Page