rewriterule causing major counter problems

Discussion in 'Apache' started by transitnetwork, Feb 19, 2009.

  1. #1
    Okay this has really stumped me...

    I am designing a new engine for my popular download site, www.filecart.com

    The development server is on www.downloadfix.com

    now check this out

    http://www.downloadfix.com/download/29276/367/ALLCapture.php

    Under Listing views, the counter always increments by 6, even though this is the code:

    mysql_query("update inl_links set link_views=link_views+1 where link_id = '$link_id'")
    or die(mysql_error());
    Code (markup):
    BUT if I access it by the actual url, which is www.downloadfix.com/details.php?id=29276&cat=367

    It will increment by 1 as it is suppose to... the line in the .htaccess is:

    RewriteRule ^([a-z]+)/([0-9]+)/([0-9]+) /details.php?page=$1&id=$2&cat=$3
    Code (markup):
     
    transitnetwork, Feb 19, 2009 IP
  2. transitnetwork

    transitnetwork Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I changed the rewriterule to the following and it works fine now

    RewriteRule ^([a-z]+)/([0-9]+)/([0-9]+)/(.*).php /details.php?page=$1&id=$2&cat=$3
     
    transitnetwork, Feb 20, 2009 IP
  3. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Have you ever played with the RewriteLog directive ?

    It's a nifty directive that is part of a set of directives that make it possible to see exactly how mod_rewrite is working with a URL. Turning rewritelog on with a production server is a major no-no unless there's no other alternative and only for a short while, but with a development server you don't have to worry about the performance impact, RewriteLog at its' highest logging level will log every single step of a rewrite and it can help a LOT when you have strange happenings like you did.
     
    joebert, Feb 20, 2009 IP
  4. transitnetwork

    transitnetwork Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Didn't know that, thanks!
     
    transitnetwork, Feb 21, 2009 IP