In this Article, we will look at a script that sets all websites to use non-www instead of www.
When I first got into designing websites, the long domain names and having WWW at the beginning meant you were a professional website. Today, it is the shorter domain names and the non-www that make your website stand out. This script will update your applicationHost.config file to work for all your websites. (Make a backup of your config before running this script, in case something goes wrong.)
I ran this on one of my [ARR Servers] ([Application Request Routing]), which is in a [Shared-Configuration] with several others. Once you update one, all get updated. Since the ARR is the [Front-End], and the Web Server is the [Back-End], we only need to apply this to our ARR Front-End servers.
For some reason, I received the following error, even though I am the Administrator.
Restart attempt failed.Access denied, you must be an administrator of the remote computer to use this command. Either have your account added to the administrator local group of the remote computer or to the domain administrator global group.