Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6102421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:36:43+00:00 2026-05-23T13:36:43+00:00

For example in my logs I have many lines that repeat, such as: ERROR

  • 0

For example in my logs I have many lines that repeat, such as:

ERROR - 2011-07-06 09:19:01 --> 404 Page Not Found --> favicon.ico

Is there any way for me to find out who is calling these errant URLs? The favicon is just an example, there are some URLs that for example show an intent to hack, and others it’s just the same error repeated over and over and over again. Basically I’d love to know which IP’s to potentially block as well as what sites to contact if they have bad links (or if I should just redirect them on my server with .htaccess).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:36:44+00:00Added an answer on May 23, 2026 at 1:36 pm

    If you feel the need to do this, just extend the Exceptions class and override the show_404() function:

    // v2.x: core/MY_Exceptions.php
    // v1.x: libraries/MY_Exceptions.php
    class MY_Exceptions extends CI_Exceptions {
    
        /**
         * 404 Page Not Found Handler
         *
         * @access  private
         * @param   string
         * @return  string
         */
        function show_404($page = '', $log_error = TRUE)
        {
            $heading = "404 Page Not Found";
            $message = "The page you requested was not found.";
    
            // By default we log this, but allow a dev to skip it
            if ($log_error)
            {
                // Custom code here, maybe logging some $_SERVER variables 
                // $_SERVER['HTTP_REFERER'] or $_SERVER['REMOTE_ADDR'] perhaps                 
                // Just add whatever you want to the log message
    
                log_message('error', '404 Page Not Found --> '.$page);
            }
    
            echo $this->show_error($heading, $message, 'error_404', 404);
            exit;
        }
    }
    

    If you keep getting stuff like favicon.ico, there’s a good chance this is your fault, so you might want to look into that.

    Just to clarify:

    • $_SERVER['HTTP_REFERER'] will give you the URL the page was requested from, so you can see where the request originated, whether it be on your site or elsewhere.
    • $_SERVER['REMOTE_ADDR'] should give you the IP address the request was made by

    http://php.net/manual/en/reserved.variables.server.php

    Brief Example:

        if ($log_error)
        {
            $msg = '';
            if (isset($_SERVER['HTTP_REFERER']))
            {
                $msg .= 'Referer was '.$_SERVER['HTTP_REFERER'];            
            }
            else
            {
                $msg .= 'Referer was not set or empty';  
            }
            if (isset($_SERVER['REMOTE_ADDR']))
            {
                $msg .= 'IP address was '.$_SERVER['REMOTE_ADDR'];           
            }
            else
            {
                $msg .= 'Unable to track IP';  
            }
            log_message('error', '404 Page Not Found --> '.$page.' - '.$msg);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL table full of logs that shows response time from my
I have a server say 'XYZ' and many clients of different domain, say A,
I have been told that Singletons are hard to test. http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/ http://misko.hevery.com/code-reviewers-guide/flaw-brittle-global-state-singletons/ I have
I have followed the onTouch example from google located here . However, I get
What I have done so far: git svn init http://example.com/svn/trunk (latest revision is 1000)
I'm working with lots of log files, and most log files have lots of
I have an app with a navigation controller as the root view. There are
I have posted a question on here previously asking similar advise, but this project
I'd like to apologize in advance, because this is not a very good question.
I have the following codE: _logs.AddRange(elements .Select(log => new Log() { tid = (log.Element(tid)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.