Forum Discussion
Irule to redirect public ip to url
Hi Team,
Could you kindly advise for irule to redirect the public ip address to url name.
- JG
Cumulonimbus
Care to elaborate your requirement a bit more?
- ishhyd82
Nimbostratus
Hi,
We have a requirement to redirect the public ip address if we browse http:// 1.2.3.4 to be redirected to their domain website https://abc.com. I have tried with host in the irule but it didn't worked.
- JG
Cumulonimbus
Just trying to understand: Why would the user browse with an IP address rather than with a hostname? Would that be any IP address or do you have a specific IP address in mind?
- ishhyd82
Nimbostratus
There is specific IP Address and its a customer requirement, no issues with the domain website, customer wants with ip address as well & that's to be redirected to the URL website
- JG
Cumulonimbus
If you know both the IP address and the hostname, then it would be something like the following:
when HTTP_REQUEST { if { [HTTP::host] equals "1.2.3.4" } { HTTP::redirect "https://example.com[HTTP::uri]" } }
.
- ishhyd82
Nimbostratus
Let me try above irule and will let you know & what about the redirection which i have configured for the url example.com to https://example.com whether i have to add any else condition if required.
- ishhyd82
Nimbostratus
Hi JG,
Thanks for your answer, the above irule worked.
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