Forum Discussion
Rajesh_74831
Nimbostratus
I was a bit quick to reply back ... looks like it worked fine for when the URI is present but when accessing the actual url its going in a redirect loop ...
Any suggestions.
shaggy
Nov 12, 2014Nimbostratus
can you elaborate? does the actual URL redirect to another URL with a trailing "/"? Can you provide an example of the redirect loop (curl results could be handy)? I had no issues with the iRule itself - it sends a redirect in response to any requested URI that has a trailing / (below).
If you just want the iRule to modify the URI submitted to the pool member instead of a redirect back to the user, you can use HTTP::uri [string trimright [HTTP::uri] "/"] instead of HTTP::redirect http://[HTTP::host][string trimright [HTTP::uri] "/"]
> GET /test/ HTTP/1.1
> User-Agent: curl/7.37.1
> Host: 1.1.1.1
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
< Location: http://1.1.1.1/test
< Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
< Content-Length: 0
<
* Connection 0 to host 1.1.1.1 left intact
* Issue another request to this URL: 'http://1.1.1.1/test'
* Found bundle for host 1.1.1.1:
* Re-using existing connection! (0) with host 1.1.1.1
* Connected to 1.1.1.1 (127.0.0.1) port 80 (0)
> GET /test HTTP/1.0
> User-Agent: curl/7.37.1
> Host: 1.1.1.1
> Accept: */*
>
< HTTP/1.1 503 Service Temporarily Unavailable