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

Not getting 404 errors...

Discussion in 'Troubleshooting and Problems' started by robdog, Jun 3, 2011.

  1. robdog

    robdog Well-Known Member

    Anytime I go to the following URL: http://www.site_name.com/asdfasdf

    I get the following error:

    Any idea why I would be getting that instead of the build in 404 page not found error?

  2. James

    James Well-Known Member

  3. Kier

    Kier XenForo Developer Staff Member

    XenForo works by intercepting your 404s and attempting to direct them to its own systems. What you are seeing there is effectively XenForo's own 404.
  4. robdog

    robdog Well-Known Member

    AAHH... so the 404 page that I am seeing is "debug mode" 404.

    Well don't I feel stupid now, lol.

    Any chance we can get debug mode to ONLY work for admins? :)
  5. Brogan

    Brogan XenForo Moderator Staff Member

  6. robdog

    robdog Well-Known Member

    If only I could guarantee that my IP will not change, I would be good to go. :)
  7. Luke F

    Luke F Well-Known Member

    Alternatively you could set a cookie on yourself and/or check for your whole IP range.
  8. James

    James Well-Known Member

    I've been wondering about usergroup-based debug mode. Imma look into it :D
  9. Kier

    Kier XenForo Developer Staff Member

    Imma is not going to get very far. Debug mode needs to be initialised months (in programming terms) before there is a visitor object to inspect.
    Fuhrmann and James like this.
  10. ragtek

    ragtek Guest

    What about a "Unique DEBUG Cookie" ?
    It would be possible to set this in the acp, and to check in the config.php if it is set
  11. Kevin

    Kevin Well-Known Member

    Bumping as I had the same initial query as robdog. :oops:

    When not in debug mode, would it be possible to redirect 404 to the main page instead?

    .. and/or is there a template we can modify to have our own fun little 404 message?

    (And Kevin also makes a big mental note to make sure he does not have debug mode turned on with any of the public facing installs...)
  12. robdog

    robdog Well-Known Member

    You can edit your htaccess file to process the 404 before XenForo does.
  13. Kevin

    Kevin Well-Known Member

    I've already tried modifying the .htaccess file that comes with XF to change the 404 value to another page but no luck, I just keep getting the stock XF page.

    (Or I was half-asleep when I tried and made a bad edit; will try again this weekend.)
  14. robdog

    robdog Well-Known Member

    can you post your htaccess file so I can see it?
  15. Mike

    Mike XenForo Developer Staff Member

    XF needs to handle every request, as none of the rewritten requests exist as files. So you can't use a 404 handler on it.

    What you're looking for is XenForo_ControllerPublic_Error::actionErrorNotFound.
  16. Kevin

    Kevin Well-Known Member

    Thanks, Mike. Now I just have to go figure out what that means entirely.... :X3:

Share This Page