Forum Discussion
Derrick_85757
Nimbostratus
Aug 26, 2008Webpage redirection
I am a newbie to iRules so pardon my stupidity. I have a client that requested a http to https redirection for a website. I created the http VS and https VS and applied the iRule for redirection. This works just fine. Now the client has come to me and asked me to redirect their old URL's to their new one. For example, they need www.xxyy.com and www.zzyy.com to be redirected to www.yyy.com. Simple redirection would work fine for this, but since I have to redirect http to https in conjunction with changing the URL, and since there are multiple URLs to redirect, I am not sure how to do this. Any advice would be greatly appreciated.
1 Reply
Sort By
- hoolio
Cirrostratus
Hi there,when HTTP_REQUEST { HTTP::redirect https://newsite.example.com[HTTP::uri] }
when HTTP_REQUEST { Check the Host header value (set to lower case and using wildcard matching) switch -glob [string tolower [HTTP::host]] { "*.example.com" { HTTP::redirect https://newsite.example.com[HTTP::uri] } "*.example2.com" { HTTP::redirect https://[HTTP::host][HTTP::uri] } default { HTTP::redirect https://newsite2.example.com } }
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