Forum Discussion
Christian_Becer
Nimbostratus
May 12, 2009301 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
- The_Bhattman
Nimbostratus
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
Cirrostratus
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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects