The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

using .htaccess to log visitors refereer & ip

Discussion in 'General Discussion' started by Moka, Jul 20, 2014.

  1. Moka

    Moka Registered

    Joined:
    Jul 20, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    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 something other ?
    Currently I'm using Apache with CentOs Operating system 6 and c-panel


    thanks for help
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    You can't do this with .htaccess. All hits to a site would already be logged in the Apache access log, and if you have log archiving enabled you'd already have what you need.
     
  3. Moka

    Moka Registered

    Joined:
    Jul 20, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks for replay,
    can i configure Apache to create an custom log file that logs only extra.jpg logs ?
     
  4. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider

    Not really. However, again, with this data already being in your access logs, why can't you simply create a script to parse out lines containing 'extra,jpg'?
     
  5. Moka

    Moka Registered

    Joined:
    Jul 20, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Re: using .htaccess to log visitors refereer & ip

    i like geek girls like you :v

    - - - Updated - - -

    what if i have a big log files ?
     
  6. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Re: using .htaccess to log visitors refereer & ip

    Don't worry, it's probably not as big as you think it is.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,829
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You may also want to consult with your web hosting provider to see if they can provide you with the output that you seek.

    Thank you.
     
Loading...

Share This Page