Forum Discussion
jeff_parten_106
Nimbostratus
Nov 27, 2006many to one uri redirect
Good day to all,
If someone could please point me in the correct direction, it would be greatly appreciated.
We have over 100 domain names all pointing to one address (e.g., sleepingbeauty.com, monstersinc.org, pinocchio.com, dubo.net etc. all go to 192.168.10.50), the main domain name is www.disney.com pointing to the same address of 192.168.10.50. www.disney.com also has a SSL certificate which the bigip is redirecting all http connections to https. (this works fine)
We have been taskted to redirect all domain names that go the the web server to www.disney.com. Below is one of the scripts we were testing.
when HTTP_REQUEST {
if { not ([HTTP::uri] matches "www.disney.com") } {
HTTP::redirect http://www.disney.com
}
Any ideas?
Thanks
J.
- JRahm
Admin
You probably want [HTTP::host] instead of [HTTP::uri] - jeff_parten_106
Nimbostratus
I tried to just get the redirect working with this script below using the [HTTP::host] and received a page can not be displayed error - hoolio
Cirrostratus
Hello,when HTTP_REQUEST { log local0. "client [IP::client_addr] requested [HTTP::host][HTTP::uri]" if { [string tolower [HTTP::host]] contains "pinocchio.com" } { HTTP::redirect "http://www.disney.com" } }
- jeff_parten_106
Nimbostratus
I do appreciate your suggestions Aron. I was however able to get the redirect working with the iRule below. One of the problems I was having is I had two redirects attached to the same virtual server. I found by looking at the /var/log/ltm logs you can only have one per virtual server. So I combined the http to https and the many to one in one iRules. I called the iRule:
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