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

ErrorDocument (.htaccess)

Discussion in 'XenForo Questions and Support' started by kuyenmotdivad, Nov 22, 2011.

  1. kuyenmotdivad

    kuyenmotdivad Active Member

    Hi,

    How come if I add this to my .htaccess it still gives thisusing XF : if I type something that does not exist like a file or folder - http://mysite.com/hjhjh (A controller for the route path hjhjh was not found.) and it does not goto my error 404 document instead?

    PHP:
      ErrorDocument 400 /errors/400.php
      ErrorDocument 401 
    /errors/401.php
      ErrorDocument 403 
    /errors/403.php
      ErrorDocument 404 
    /errors/404.php
      ErrorDocument 500 
    /errors/500.php
    But if I add the bit in .htaccess that was included with XF below

    PHP:
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
    I still get the same error (A controller for the route path hjhjh was not found.)
     
  2. Mike

    Mike XenForo Developer Staff Member

    Every file in XenForo is found because the rewrite rule matches everything, unless it's in certain directories.
     
  3. kuyenmotdivad

    kuyenmotdivad Active Member

    So custom error document is useless inside the xf install?
     
  4. Mike

    Mike XenForo Developer Staff Member

    Unless you remove the .htaccess completely (and don't use full friendly URLs) or the 404 happens within a specific directory (eg, styles), yes.
     
  5. kuyenmotdivad

    kuyenmotdivad Active Member

    On your website I notice if I type in something random it shows http://xenforo.com/community/fgfgf as page not found but on mine it shows as A controller for the route path was not found.
     
  6. Mike

    Mike XenForo Developer Staff Member

    That's just because you're in debug mode (which shouldn't be enabled on production websites).
     
    kuyenmotdivad likes this.
  7. kuyenmotdivad

    kuyenmotdivad Active Member

    Very helpful thanks a lot.(y)
     
  8. Floris

    Floris Guest

Share This Page