Redirect Web Interface on Citrix NetScaler with Rewrite function
November 12, 2010 11 Comments
When you install and configure Web Interface on Citrix NetScaler nCore you probably notice that there is no option to automatically go to the default Citrix XenApp page as you were used to in a Microsoft IIS install of the Citrix Web Interface. Once you have set up Citrix Web Interface and you add the newly created address in the browser you will get an “Invalid Path” notice. This would mean you (or your users) always would have to fill in the subdirs also.

Off course this can be nicely resolved with a Rewrite function within the Citrix NetScaler and here I will show you how to.
Command line version:
add rewrite action rw_ac_xenapp replace HTTP.REQ.URL "\"/Citrix/XenApp\""
add rewrite policy rw_pol_xenapp "HTTP.REQ.URL.EQ(\"/\")" rw_ac_xenapp
bind lb vserver 10.13.14.21_80 -policyName rw_pol_xenapp -priority 100 -gotoPriorityExpression END -type REQUEST
GUI Version:
Go to Rewrite –> Actions and click Add. Create the Action as in the screenshot below:

Click OK and go to Rewrite –> Policies. Create the Policy as in the screenshot below:

And the last step. Bind the newly created policy to the Web Interface Virtual Server:

Start a browser and visit the Web Interface address. There u go. Could not redirect faster then that you guys!
Great post. I’m facing the same problem. What about having an home page displayed where to let user choose different Web Interface Sites? Is it worth using the rewrite to replace that page with some html code?
Thanks.
Yes, that would be possible, but you will have to know where that you want NetScaler to react on, originating IP, host header, etc.
You could also create 2 DNS entries, one for each site and then create a rewrite function for every incoming DNS address to change to the specific Web Interface when it comes in.
Hello Henry. I found your site today. Maybe you can help me to find solution for my netscaler VPX installation. I try to install AGEE and xenapp service site on Netscaler VPX, version is NS9.2: Build 48.6015.e.nc. Now I have one Virtual AG server with turn off authenticarion and xenapp service site in gateway direct mode. It works fine, but I can’t use the single sign on for xenapp service site. I Also set “WIAuthenticationMethods=SingleSignOn” in the WebInterface.conf file, but i doesn’t help in the gateway direct mode. Also I have installed another Xenapp Service Site by direct mode and when I set “WIAuthenticationMethods=SingleSignOn” the Single Sign On work. Do you know Is it possible to use Single Sign on the xenapp service site and AGEE on the Netscaler Vpx Appliance with gateway direct mode?
I have had the exact same problem. You probably would like to create a Citrix XenApp Services to use with AGEE and Citrix Receiver for iPad/iPhone/etc.
Seems that Citrix XenApp Services site passthrough (or SSO) authentication does not yet work within the Citrix Web interface for NetScaler. Now, I’m not sure about the most recent builds.
The only workaround I know is to still use Windows Citrix Web interface Servers in the backend for use with Citrix Receiver.
If you can confirm this problem on your site I will try and create a support ticket with Citrix Tech Support.
Hello Henry.
Thank you very much for your reply. Do you try to set Web interface (Web site) for those functions?
I’m trying to setup website on the ncore with “Single Sign on”. But I can’t use “Single Sign on” either I use Gateway Direct mode with Authentication at the AGEE or Gateway Direct mode with Authentication at the Web interface. I also Can’t use “Single sign on” in the “direct mode”. When I set “WIAuthenticationMethods=SingleSignOn” I always get Error “Invalid System Configuration”. Do you know any possibility to use “Single sign on” with the Web Site in the Ncore? Where I can setup Authentication on Website if I use direct mode or gateway direct mode (with authentication point in the web interface)? Is it possible to use “single sign on” at the gateway direct mode, when authentication point at the AGEE ( use “single sign on” for Authentication at the AGEE)?
Hey Henry,
Thanks sir, you are a lifesaver on this! I do have a question though. Do you know how one would go about setting up a redirect from non-secure http://www.yourwebsite.com to secure https://www.yourwebsite.com/Citrix/XenApp
Thanks in advance!
Walter
Hi Walter,
Apologies for the late response, look at this page to use a rewrite function to go from non-secure http to secure https:
http://community.citrix.com/display/ns/Rewrite+Policy+-+Redirect+HTTP+Requests+to+HTTPS
A good alternative would be to open the Virtual Server that you would like redirected, go to the Advanced Tab and fill the field “redirect URL” with the secure one.
Hello,
After performing the above commands and trying the GUI, I still get the “Invalid Path” when going directly to IP. Thanks in advance..
Hello HenryL,
After a little exploring, I realized that the “rewrite” option was not enabled within “Configure basic features”. Once enabled, it worked like a charm. Thanks again!!!!!
Hi Henny!
Nice tip in a nice post! Thanks guy!
Kind regards,
Cristiano Santos
It works,
Thanks!