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

Page not Found 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

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

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