Showing results for 
Search instead for 
Did you mean: 

Redirect AND mask URL?

New Contributor

Redirect AND mask URL?

I have a website that I want users to access at which actually resides at I can get the redirect from to working without any problems, but I can't seem to get the address bar to reflect the URL that I need.

The rule I am using now (that doesn't work) is as follows. It is What am I missing?

$host = http.getheader( "Host" );

if($host == "" ){

   http.redirect( "" );

   http.setHeader( "Host", "" );


Thanks for the assist!


Re: Redirect AND mask URL?

Hi Aaron,

a http.redirect immediately sends out the response and further traffic script will not be executed. Thats why your rule just ends at the line "http.redirect".

But what do you want to achieve? a redirect tells the browser "got to the new url", so your old url will not be displayed/used anymore.

If you want to keep the old URL in the browser and just show content from the new, you can use the new one as a "node" (but linking withing the website could be tricky...)


New Contributor

Re: Redirect AND mask URL?

We are trying to set up a default website for one of our wireless SSIDs which all traffic will be forced to when people connect to it. I am trying to deliver the contents of a flat website (so linking in the site is not an issue) that is on an existing web server along with several other sites (all of the sub-sites are in folders off of the main site).  In order for it to work, everything needs to appear as coming from root level of to the end user, so both the redirect and the URL masking is critical. Any other thoughts on how to make this happen?


Occasional Contributor

Re: Redirect AND mask URL?

Hi Aaron:

Try this:

if( http.getHostHeader() == "" )


   http.changeSite( "" );





Re: Redirect AND mask URL?

create a vserver for

then use a rule to

1. set the http header to the correct value

(i guess http.setHeader( "Host", "" );

2. set the url

http.setPath( "/something" );

3. create a pool (named "poolwithoneserver") with one server:

4. last statement of the rule:


so, your existing server is just a node for a different vserver, and you have to modify the path and the hostheader for every request.

New Contributor

Re: Redirect AND mask URL?

So I finally got a chance to work on this some more, but I couldn't get your solution to work. I could get the URL to point to the correct server, but for some reason the web server was bringing up one of its vhosts instead of the site I wanted. To solve the problem, I just added the site as anoher vhost on that server and I was able to solve the problem without using the Traffic Manager at all. I guess I just had to think outside of the confines of the load balancer. Thanks for the help!