Forum Discussion

bdragna_8791's avatar
bdragna_8791
Icon for Nimbostratus rankNimbostratus
Feb 20, 2008

iRule - How to pull specific information from host headers

I'm trying to rewrite a HTTP host header based on the original header information. I want to rewrite the header "www.yourdomain.com" to "yourdomain.mydomain.com", but I don't know how to pull just the domain name without the "www" and "com".

 

 

I understand how to pull the host information and rewrite or redirect, but what if I just want the "domain" part for the rewrite.

 

 

Hope I'm being clear. I'm kind of new to the forum, so any help would be appreciated.

 

 

Thanks,

 

 

Blase
  • Hi,

     

     

    You can do it this way for example:

     

     

    set domain [getfield "www.yourdomain.com "." 2]

     

     

    HTH

     

     

    N.