using .htaccess to log visitors refereer & ip

Discussion in 'Site & Server Administration' started by moath11, Jul 20, 2014.

  1. #1
    I've tired searching on the web so i posted this question here
    i have an file called extra.jpg and i want to log visitors ip with referrer using .htaccess

    it's possible on Apache ? or should i use IIS or something other ?
    Currently I'm using Apache with CentOs Operating system 6 and c-panel


    thanks for help
     
    moath11, Jul 20, 2014 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,807
    Likes Received:
    4,534
    Best Answers:
    123
    Trophy Points:
    665
    #2
    There may be a better way of doing this but in the olden days we'd:
    • use .htaccess to convert the request to catch.php?img=$1
    • catch.php would log the request, send out image headers and send out the image
    depending on how you set up the ereg match you can include all images, just images in a certain folder or just images with a particular name.
     
    sarahk, Jul 20, 2014 IP