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

XF 1.3 Redirect 404 to Homepage

Discussion in 'XenForo Questions and Support' started by I. C. Daniel, May 1, 2014.

  1. I. C. Daniel

    I. C. Daniel Member

    Ahoy there!

    I have 240 404 errors, most of them are from wordpress based site I wanted to develop, after that I found this awesome software called xenForo, I tried demo and was love at first sight :D

    So now I want to redirect them to homepage? Should be okay? How can I do it via .htaccess?

    I need your help, thanks in advance.
  2. MattW

    MattW Well-Known Member

  3. tommydamic68

    tommydamic68 Well-Known Member

    I like to use a custom 404 error page to do the redirecting to my site. Its good SEO (as long as it is not large numbers of error pages redirecting to a 404) as well as the end users experience.:)

    Mine. Its slightly animated as well.
    Screen Shot 2014-05-01 at 8.38.41 PM.png
    Donny likes this.
  4. I. C. Daniel

    I. C. Daniel Member

    Is not working or I'm doing something wrong. My forum is http://ypayz.com/

    This is .htaccess
    #    Mod_security can interfere with uploading of content such as attachments. If you
    #    cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    #    SecFilterEngine Off
    #    SecFilterScanPOST Off
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
    <IfModule mod_rewrite.c>
        RewriteEngine On
        #    If you are having problems with the rewrite rules, remove the "#" from the
        #    line that begins "RewriteBase" below. You will also have to change the path
        #    of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
        #    This line may be needed to enable WebDAV editing with PHP as a CGI.
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    I don't want custom 404. I want redirect to homepage, but how?
  5. MattW

    MattW Well-Known Member

    This works for me on a test site:
    ErrorDocument 404 http://old.britishmods.com/index.php
  6. ibrian

    ibrian Active Member

    ErrorDocument 404 http://old.britishmods.com/index.php
    I'm afraid this doesn't work for me, either.

    Surely there's a simple solution for redirecting a 404 to the forum homepage, instead of the default error page? Just that it does nothing to encourage visitors to interact with a website.
  7. dethfire

    dethfire Well-Known Member

    What's Google's say on this. I don't think they'd like it. If a page doesn't exist they want to know it and for users to know it.
  8. tommydamic68

    tommydamic68 Well-Known Member

    For SEO purposes, it's best to have a working 404 page, it's not recommended to have an error page redirect to your forum.
    dethfire likes this.
  9. ibrian

    ibrian Active Member

    For SEO purposes, it's best to redirect with a 404 error. :)

Share This Page