Forum Discussion

Ben_Noonan's avatar
Ben_Noonan
Icon for Nimbostratus rankNimbostratus
Mar 23, 2018

Rewrite HTTP Address Displaying

Hi All,

I don't know if this is possible but I am trying to make the end user not see the page redirect in the address bar.

For Example:

User goes to webpage.domain.com/loginpage

That hits a VIP which redirects the traffic to server.doamin.com/loginpage

Now can I make it so in the address bar it is still showing webpage.domain.com/loginpage instead of server.doamin.com/loginpage ?

This is what I have some up with so for, bare in mind still new to iRules:

when HTTP_REQUEST {
if {
    [string tolower[HTTP::host] not "webpage.domain.com"]}{ 
    HTTP::header replace host "webpage.domain.com"}
    return
}

2 Replies

  • Address bar will not change with iRule. Client needs to re-connect to the redirected page.

     

  • Surgeon's avatar
    Surgeon
    Ret. Employee

    Not totally clear what you are going to reach. Do you still want clients go to server.doamin.com/loginpage or you just want to replace HOST header?

     

    If you want clients go to server.doamin.com/loginpage then you have to use redirect. If you do not use redirect, how are you going to notify clients about new host?

     

    If you want just replace HOST header than your iRule should work