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:
1 |
<meta http-equiv="refresh" content="0;url=http://NewURL/Citrix/XenApp/"> |
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:
1 |
window.location="/Citrix/XenApp"; |
so change it to:
1 |
window.location="/Citrix/301Redirect"; |
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.
Jason Samuel is a visionary product leader and trusted advisor with a proven track record of shaping strategy and driving technology innovation. With extensive expertise in enterprise end-user computing, security, cloud, automation, and virtualization technologies, Jason has become a globally recognized authority in the IT industry. His career spans consulting for hundreds of Fortune 500 enterprises across diverse business sectors worldwide, delivering cutting-edge digital solutions from Citrix, Microsoft, VMware, Amazon, Google, and NVIDIA that seamlessly balance security with exceptional user experiences.
Jason’s leadership is amplified by his dedication to knowledge-sharing as an author, speaker, podcaster, and mentor within the global IT and technology community. Recognized with numerous prestigious awards, Jason’s contributions underscore his commitment to advancing technology and empowering organizations to achieve transformative results. Follow him on LinkedIn.
Siegfried
February 1, 2019 at 4:13 AM
Hello,
Thanks a lot!
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.