.htaccess and huge bandwidth consumption.

Discussion in 'Programming' started by HarriL, Mar 31, 2011.

  1. #1
    I bought a site some time ago. It's a quite small site and should consume only a few gigs of bandwidth per MONTH. I just got an email from my hosting company regarding my bandwidth consumption and noticed that this site is using 30-40 gigs per DAY.

    I took a look at the logs and noticed that pretty much all was used by 302 Moved temporarily (redirect).
    So I took a look at the .htaccess and there was this:
    ------------
    "RewriteCond %{REQUEST_URI} !(js|admin|images|img|css|captcha)/(.*)

    RewriteRule ^([^\.,/]+)$ http://%{HTTP_HOST}%{REQUEST_URI}/ [R=301]"
    ---------------------
    I removed it and now everything looks normal and bandwidth usage is only a fraction of what it used to be. Does anybody know what that code actually did? Did it create some kind of loop?
     
    HarriL, Mar 31, 2011 IP