Forum Discussion
Redirect and append URI
I'm redirecting URLs using HTTP profile, but I need to append the text value after '/'. For example, when the end user type 'www.mmicagent.com/fasih', it should redirect and append to 'www.motoristsmutual.com/map/ouragents/mmicagent/fasih'.
Thanks for your help.
Fasih Ahmed
2 Replies
- Kevin_Stewart
Employee
Please try this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "www.mmicagent.com" } { HTTP::redirect "http://www.motoristsmutual.com/map/ouragents/mmicagent[HTTP::uri]" } }This will append whatever URI the client specifies to the end of the redirect URL.
- Kevin_Stewart
Employee
Will it replace 'www.mmicagent.com' with 'www.motoristsmutual.com/map/ouragents/ mmicagent' and append '/fasih' which was originally part of the orignal URI
Yes. If the request is for www.mmicagent.com, the user will be redirected to www.motoristsmutual.com. Any URI that is in the original request will get appended to the end of the redirect URI.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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