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

  • SEARCH
  • Home
  • 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'd like to receive error logs via email. For example, if a Warning-level error
I have a page that uses an AJAX request (using Prototype's Ajax.Request()) to validate
Im writing a application that reads logs from 1-many computers in the network. The
I have a site which is searchable using Lucene. I've noticed from logs that
How critical are transaction logs after a full backup of a SQL2005 database? Example:
Example: You have a shortcut s to SomeProgram in the current directory. In cmd.exe
Example I have Person , SpecialPerson , and User . Person and SpecialPerson are
I have a SQL 2005 table consisting of around 10million records (dbo.Logs). I have
I'm not great at PHP, and everything I currently know, I have just taught
Does anybody have any advice on how to minimize my logs for a web

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.