Forum Discussion

dlogsdonmd's avatar
dlogsdonmd
Icon for Nimbostratus rankNimbostratus
Feb 04, 2020

HTTP::respond iRule Not Working

Hello,

I'm trying to determine why an iRule to redirect a domain to a different domain is not working. I believe we have the iRule properly configured, but I want to check with the experts here to be sure. The rule is below.

I suspect the issue is a DNS related. The domain A record in DNS (Network Solutions) for deputyheartattack.org is configured to point to the IP of a VIP on our LTM. We then have a number of CNAME records in internal DNS which point to that VIP. This particular domain (deputyheartattack.org) does not have a CNAME record internally or externally. If this is a domain issue, I'm not sure where it is, so far.

Appreciate any insight anyone can provide.

Diane

when HTTP_REQUEST {
  if { [string tolower [HTTP::host]] contains "deputyheartattack.org" } {
	HTTP::respond 301 Location "deputyheartattack.acc.org[HTTP::uri]"
  }
}

3 Replies

  • What error do you get in the browser?

    Use the browser Developer Tools (F12, Network tab) to see if the redirection response is sent to the browser.

    Or check with a curl request.

    # curl -kv https://deputyheartattack.org/ -H "Host: deputyheartattack.org"
    • dlogsdonmd's avatar
      dlogsdonmd
      Icon for Nimbostratus rankNimbostratus

      The normal page (deputyheartattack.org) loads still, just gives an expected SSL error. So, clearly it's not reaching the LB for some reason.

       

      Can you verify my irule is valid? I'm pretty sure it is, just want another set of eyes.