Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    830
    Likes Received:
    26
    Trophy Points:
    178
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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:
    830
    Likes Received:
    26
    Trophy Points:
    178
    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'?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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:
    830
    Likes Received:
    26
    Trophy Points:
    178
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,386
    Likes Received:
    1,857
    Trophy Points:
    363
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice