Forum Discussion

theXfactor82_91's avatar
theXfactor82_91
Icon for Nimbostratus rankNimbostratus
Jun 16, 2015

irule redirect question

We are moving a PeopleFinder feature over to a new Server so I am wanting to know if an irule could take care of the following...

 

request is http://site.com/path/peoplefinder_advanced.pl?searchStr=username&searchAttr=uid

 

redirect to http://newsite.com/peoplefinder.aspx?searchStr=username&searchAttr=uid

 

If someone could direct me to a solution that would be great. Thanks

 

  • Please try this.

            when HTTP_REQUEST {
            if { [HTTP::uri] start_with "/path/path/peoplefinder_advanced.pl" } {
        HTTP::redirect "http://newsite.com/peoplefinder.aspx?[URI::query [HTTP::uri]]"
            }
            }
    
  • Please try this.

            when HTTP_REQUEST {
            if { [HTTP::uri] start_with "/path/path/peoplefinder_advanced.pl" } {
        HTTP::redirect "http://newsite.com/peoplefinder.aspx?[URI::query [HTTP::uri]]"
            }
            }
    
  • Thanks a lot! That did the trick. The only thing I had to change was remove the searchStr= as it was giving me a syntax error when entering the irule.

     

    Final irule looked like this.

     

    when HTTP_REQUEST { if { [HTTP::uri] start_with "/path/path/peoplefinder_advanced.pl" } { HTTP::redirect "http://newsite.com/peoplefinder.aspx?[URI::query [HTTP::uri]]" } }