Forum Discussion
How to replace the hostname from a FQDN in HTTP:HOST
How is it possible to replace only the hostname within an irule?
Example:
Client requests www.trustme.com so [HTTP:Host] contains this name.
How can I replace only the "www" with "www2" and response
www2.trustme.com to the client?
Many thanx
bb
4 Replies
- Chris_Miller
Altostratus
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "www.trustme.com" } { HTTP::redirect "http://www2.trustme.com[HTTP::uri]" } }
- Andrea_Arquint
Nimbostratus
Hi ChrisI probably did not clear explain what I need.
For example:
we have some domains...
www.test1.com
www.test2.com
Now I want to get only the domains to create a new one like:
In case of www.test1.com
mobile.test1.com
In case of www.test2.com
mobile.test2.com
etc...
This should be more dynamically then with a "switch" method:
I think should be something like...
set dom [HTTP:Host]
extract only the domain in this case test1.com build the new FQDN.
I hope I did clearly describe what I mean.
Many thanx
andy
- JRahm
Admin
You were there and you didn't know it! The domain command is your friend: http://devcentral.f5.com/wiki/default.aspx/iRules/domain.html Click Here - Andrea_Arquint
Nimbostratus
Hi JasonThanx for your help...
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