jezcooke
Posts: 29
Joined: Mon May 28, 2012 4:34 pm

IIS HTTP Redirect

Hi, we have an installer for a server application that can automatically configure IIS. I need to be able to set the 'HTTP redirect' property of the installed website so that users will be redirected to the correct web application path but cannot find the option in Advanced Installer. Hopefully I'm just missing something and this is already possible?

I'm using the 'Professional' edition.

Thank you.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS HTTP Redirect

Hello,

This can be done by using the "Custom Properties" tab of your web site added in "IIS" page. However, please note that these settings will be applied only for IIS 7 or newer versions. On machines with an older IIS version these settings will be ignored.

Here are the steps to proceed:
1. go to "Custom Properties" tab and add two new attribute values like this:
  • Section: system.webServer/httpRedirect
    Name: enabled
    Type: boolean (True/False)
    Value: True

    Section: system.webServer/httpRedirect
    Name: destination
    Type: string
    Value: <desired URL>
2. in order to be configured the above settings require the "HTTP Redirection" IIS subfeature to be installed on target machines; therefore you can add in "Prerequisites" page a Windows Feature Bundle which will install the "HTTP Redirection" IIS subfeature (you can use the Filter box from the tope right section of the page to search for the "HTTP Redirection")
3. build and test the project

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jezcooke
Posts: 29
Joined: Mon May 28, 2012 4:34 pm

Re: IIS HTTP Redirect

Hi Daniel,

Thank you very much for the reply, only thing is that I don't have the "custom properties" tab for the "default website", I can get to it for a custom site or for virtual directories on the default website. Can I set this property on the default website?

Many thanks.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS HTTP Redirect

Hello,

Unfortunately, we don't have support to set custom properties for the default web site. As a workaround, you can try to develop your own custom action which sets the related web site setting.

Can you share with us the reasons why you need to set this setting for the default web site? Don't you install your own web site?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jezcooke
Posts: 29
Joined: Mon May 28, 2012 4:34 pm

Re: IIS HTTP Redirect

Hi, thanks for your reply and happy new year!

There's a couple of reasons we use the "Default web site", in most cases the machine will be dedicated to run our application so we would generally want the "all unassigned" binding (as we wouldn't know the specifics at install time). This would conflict with the default website and so our new website would not start without either disabling the default website or editing its bindings (we try to make the installation as simple as possible) can we disable the default website using Advanced Installer (Pro)?

In some cases we may install on a machine that is already using IIS, in that case by using the default web site then we can happily co-exist with the existing site (i.e. one also using "default web site"), the path structure to our app should (in most cases) prevent conflicts with existing paths.

In more unusual installs that fall outside of these situations we have the option in the installer to not configure IIS at all and can provide instructions/support to setup IIS manually to suit their needs (which may indeed involve creating a dedicated website on IIS), this is fine but we also want to achieve as close as possible to a "just works" install for the most common scenario.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS HTTP Redirect

Hello and a Happy New Year to you too!

Thank you for your feedback.

Please keep in mind that if your are installing your own (new) web site having the same bindings as an existing installed one (including the default web site too), then at install time Advanced Installer will automatically stop the existing site (e.g. default web site) and start your new installed one. Also, after the installation on a system restart your new installed web site will be started first (before the existing ones having the same bindings) and the existing ones will be stopped. So, if you are installing under a new web site, then you shouldn't have any issue regarding the web site bindings.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”