For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Christian_Becer's avatar
Christian_Becer
Icon for Nimbostratus rankNimbostratus
May 12, 2009

301 Redirect - Searched and Lost

Hello to all and thanks for your time.

 

 

I have been searching the forums all morning but have not found something exactly that I need. Tried a few of the iRules on the forum but does not seem to work.

 

 

Basically I want to try to accomplish the following:

 

 

if the user types in http or https://www.mysite.com/adult-student-scholarship that is do a 301 redirect and pull the information from

 

 

http://pages04.net/dir1/adult-student-scholarship but I want to be able to mask the uri to show http or https://mysite.com/adult-student-scholarship.

 

 

Let me know if I make sense or if someone has solved this in another forum entry.

 

 

Thanks

 

 

301 Crazy

 

2 Replies

  • Give this a shot.

      
     when HTTP_REQUEST {  
        set new_host "pages04.net"  
        if {[HTTP::uri] eq "/adult-student-scholarship"} {  
         HTTP::header replace "Host" $new_host  
         HTTP::uri /dir/[HTTP::uri]  
        }  
     }  
     

    Hope this helps

    CB
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    I think you'll get a syntax error until you remove the braces from HTTP::uri when setting the URI:

     

     

    HTTP::uri "/dir/[HTTP::uri]"

     

     

    Also, it would be a bit more efficient to change all of the URI references to HTTP::path.

     

     

    Aaron