Citrix XenApp

How to redirect your XenApp Web Interface site to a new URL without breaking PNAgent sites

Had a request today to redirect a XenApp site on an old set of Web Interface 5.4 servers to a new URL as part of a brand change (domain name migration). Normally you could go into IIS and do a 301 or 302 redirect via a secondary site and push traffic to the correct site using host headers and you’d be good. Or even use a Netscaler rewrite policy if the servers were behind one. The catch in my scenario was there were PNAgent sites on the WI that still used the old URL and they had to remain working. Kind of tricky since Citrix puts all it’s sites under the “Default Web Site” by default. I had to make sure the PNAgent site used the old URL while only GUI users navigating to the old URL in their browser would get redirected to the new URL. And I didn’t have the benefit of a Netscaler in front of these servers to help me.

NOTE: If you do want to do a complete migration away from the old URL (on all GUI, PNAgent, Access Gateway sites, etc) and need to update Citrix Receiver Enterprise, the easiest way to update the server URL on them is via GPO. Or you can do it via registry if you have an endpoint management solution. I prefer using group policy. Just remember to keep both URLs working for a bit because not all your endpoints may get the update at the same time. Especially true of laptop/mobile users. PNAgent (Receiver Enterprise) doesn’t handle 301 redirects well in my experience so I prefer they not use a legacy URL and actually get updated/hard coded to the correct URL at some point.

So on to the steps:

1. On your WI servers navigate to “C:\inetpub\wwwroot\Citrix” and you will see all your sites. Create a folder in here called “301Redirect” or whatever makes sense for your company.

2. Inside this folder, create a “default.htm” file. Open it and edit it with the following:

This is a 301 redirect, same as you would do in IIS but without having to mess with the IIS config. By default “XenApp” is your GUI site unless you’ve changed it. I don’t recommend messing with the IIS config unless absolutely necessary since the Web Interface Management console also interacts with the IIS config. I prefer just using code in this instance for the 301. It’s also easier to manage across many Web Interface servers and other people that may come in after you won’t have to dig through the IIS console to see what you have done.

3. Navigate to “C:\inetpub\wwwroot” and edit the “WebInterface.htm”. By default it will say:

so change it to:

4. At this point you should be able to hit the old URL via a web browser and it should redirect you the new URL. Login to the XenApp site and try launching an app. Then try launching an app using Citrix Receiver Enterprise/PNAgent and that should still work as normal since we didn’t touch any of the Services sites. You can even logout and login under Online Plugin Settings just for grins. If you use Access Gateway it should be talking to these services sites too so you don’t have to change anything in your Access Gateway session profiles. The old URL will continue to work there.

Hope this helps. Please post a comment if you run into any issues.

2 Comments

  1. Siegfried

    February 1, 2019 at 4:13 AM

    Hello,

    Thanks a lot!

  2. gdowling

    February 7, 2022 at 4:07 PM

    Will this work if users have the auth\login.aspx file saved as a favorite? Also, would this also work for WI 4.5? I am in the process of disabling old WI 4.5 and 5.4 sites and want to nudge them over to StoreFront 3.12.

    Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Apache

Today I would like to go over proper URL redirection when using SSL but first I would like to preface this by describing what...

Citrix Workspace

You can use FIDO2 hardware security keys plugged into your physical desktop over the Citrix HDX remoting protocol for use with virtualized Windows Desktop...

Exchange 2003

A useful Exchange 2003 guide I wrote for a friend’s blog originally but I am posting it here on mine now for your viewing...

Apache

In a worst case scenario and all your web servers have failed, what do you do? You could have a standby group of servers...

JasonSamuel.com began in 2008 as a way for me to give back to the IT community. This website features the latest news and how-to's on enterprise mobility, security, virtualization, cloud architecture, and other technologies I work with. This website has evolved over time to become a go-to reference hub for these technologies. It receives hundreds of thousands of unique visitors from all over the world each month. More details on the About Me page.
Copyright © 2008-2023 JasonSamuel.com

Exit mobile version