Forum Discussion
301 redirect in chrome issue
I have tried about three versions and still get the same issue..
In chrome, it works just fine the first time...then if I try again without closing chrome it just spins to no end.
it works fine in IE....
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "qa.client.abc.com" } {
HTTP::respond 301 Location "https://qa.client.800abc.com"
}
}
Thanks
12 Replies
- Brad_Parker
Cirrus
Does client https://qa.client.800abc.com respond when you go to it? - F5Hopper_28651
Nimbostratus
yah, it works just fine.. is this normal? in testing again... now all browsers spin..hmm - oshaughnessy_19
Nimbostratus
Try it with
from a shell and see if you get the Location header you're expecting:curlcurl -ski -o- http://qa.client.abc.comYou should see the HTTP response header, then the new location:
HTTP/1.0 301 Found Location: https://qa.client.800abc.com Server: BigIP Connection: Keep-Alive Content-Length: 0If you get something else, it might explain strange behavior from Chrome. If you get something like the above, I think it's working correctly.
- F5Hopper_28651
Nimbostratus
I ran the command but I don't see any return... I'm in the Advanced Shell...
- DevBabu
Cirrus
It's returning perfectly for me: [root@localhost named] curl -ski http://qa.client.abc.com HTTP/1.0 301 Moved Permanently Location: https://qa.client.800abc.com Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@localhost named]
- oshaughnessy_19
Nimbostratus
Do you have a virtual server that's handling traffic for qa.client.abc.com? Is it listening on port 80?
Is there, perhaps, a typo in your example? One line in your code uses the domain "abc.com", and the other "800abc.com". Are you just trying to redirect HTTP to HTTPS, or are you trying to change the domain, too?
- F5Hopper_28651
Nimbostratus
the old working URL was qa.client.abc.com both HTTP and HTTPS. I removed the pool and added the irule above for both HTTP and HTTPS. the new site qa.client.800abc.com is fully working on its own. this setup is on an old LTM 1500, BIG-IP 10.2.0 Build 1789.0 Hotfix HF2
- oshaughnessy_19
Nimbostratus
Add the `-v` flag to curl: curl -v -ski -o- http://qa.client.abc.com * getaddrinfo(3) failed for qa.client.abc.com:80 * Couldn't resolve host 'qa.client.abc.com' * Closing connection 0 It doesn't resolve for me, but perhaps it works for you within your data center.
- F5Hopper_28651
Nimbostratus
ok it might help to have a DNS server added....
[admin@bip1:Active] ~ curl -ski -o- http://qa.client.abc.com HTTP/1.0 301 Moved Permanently Location: https://qa.client.800abc.com Server: BigIP Connection: Keep-Alive Content-Length: 0 [admin@bip1:Active] ~- oshaughnessy_19
Nimbostratus
Nice. That looks like the right response. Do you get the same when you run it from your computer (or wherever you're running Chrome)?
- DevBabu
Cirrus
Have you taken any capture on your PC to see what it get's back in return from F5 LTM. Wireshark or some Fiddler capture.
For me it is working perfectly
[root@localhost named] curl -ski http://qa.client.abc.com HTTP/1.0 301 Moved Permanently Location: https://qa.client.800abc.com Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@localhost named] - F5Hopper_28651
Nimbostratus
I did check Fiddler, didn't see anything standing out... I also setup another VirtualServer on another domain and added a version of the irule and it routed just fine... maybe the host server or site is being funny... I'm going to add the qa.client.*** to the new VitualF5 I have and test again.
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
