Forum Discussion

Drew_123833's avatar
Drew_123833
Icon for Nimbostratus rankNimbostratus
Mar 31, 2014

Analyzing requests

Hi there

 

This weekend we changed our website. All went well. Only a few issues. We removed the /item/..... subpage. (www.example.com/item/....). The problem is that we still get hundreds of requests to this subpage. We did do a redirect to another website subpage, but for some pages it goes well to specific subpages and for some not. The problem is that for pages that starts with '&' it doesn't do anything for example: www.example.com/item/results&year=2010&TypeID=14..... (in this case after results). Not all our pages are with results of course. We can't see where these requests are coming from.

 

  1. Is there a way to see where these requests come from?
  2. How do we configure in BIGIP to redirect these pages to the right destination? Through irule?

Is this possible?

 

Thx Best Regards

 

6 Replies

  • Hi Drew

    You should be able to see the origin of the requests in your web server logs, if not there are ways of logging it, but it'd make your LTM log a bit messy, so I'd recommend using scripts (ie python or powershell) for your old logs (there would be no new ones if you redirect with the F5).

    Try this rule:

    when HTTP_REQUEST {
        set path [string tolower [HTTP::path]]
    
        if { $path starts_with "/item" } {
            HTTP::respond 301 Location https://[HTTP::host]/the-new-uri/
        }
    }
    

    This would trigger for /items too so if you want to be more specific you can chose "/item/" as condition.

    If you want a logging function you can try this:

    when HTTP_REQUEST {
        set uri [string tolower [HTTP::uri]]
    
        if { $uri starts_with "/item" } {
            if { $uri contains "&" } { log local0. [IP::client_addr] }
            HTTP::respond 301 Location https://[HTTP::host]/the-new-uri/
        }
    }
    

    Right now it only logs the IP of the client, but you can change it to your liking.

    /Patrik

  • Hi Patrick

     

    Thanks for your reply!

     

    The challenge that we have is that the links are variable. We get thousands of requests. It means that for example: http://www.example.com/item/results$ad=1&year=2010&TypeID=14... (does not exist anymore) we want to redirect: http://www.our_other_website.com/en/another_productOff=45&Ord=1&CatID=1&DestID=1&Pos=1

     

    So for the existing one, there is already an handler by our programmer. But for other links not, so we can't catch them, cause they don't exist anymore.

     

    Maybe the 'others' we can redirect to /item/home or something? I don't know if LTM kan handle this?

     

  • Hi Drew! How many redirect conversion cases are we talking about?

     

    If its not an insane amount you could translate them in a data group list.

     

    If it is, could you please give a few more examples of URIs that you want to translate? It'd help define a general rule.

     

    /Patrik

     

  • Hi Patrik

     

    We get 7000 requests links. Example: http://www.example.com/item/results&Price=0;1500&Fuel=1&TypeID=10;11;12&Bid=1&Day=1&Off=45&Ord=1&CatID=1&DestID=1&Pos=1

     

    http://www.example.com/item/results&Price=0;5000&Day=1&Off=45&Ord=1&CatID=1&DestID=1&Pos=1 http://www.example.com/item/results&Price=0;20000&Day=1&Off=45&Ord=1&CatID=1&DestID=1&Pos=54 http://www.example.com/item/results&Price=0;20000&Km=0;100000&Year=2003&TypeID=14&Trans=1;3;6&Day=1&Off=45&Ord=1&CatID=1&DestID=1&Pos=1 etc...

     

    All these links receive an 404 error of course. Some of the known articles are redirected through the handler in a decent way. Or maybe should we wait till others see the error and stops requesting?

     

  • Hi!

     

    Normally I'd advise to do this in the application but technically 7000 links would not be a problem for an iRule using a group list. Do you have all the URIs you want to translate in an excel spreadsheet or are they undocumented?

     

    If they're undocumented perhaps you'd like to send the guests to a special landing page explaining why their link is not showing and a search form?

     

    /Patrik

     

  • Hi Patrick

     

    It's a while.... so it will be polite to just answer here the results I guess :-). We didn't take any action actually, the links went to the 'not found page'. The links were not documented either. So the requests stopped after a month.

     

    But for future purpose or future happening: Maybe there exist a tool to catch them and put them on a list automatically? Or should we just ignore them.

     

    Thx for your previous reply by the way. See you around here.

     

    Drew