Use Websites Instead of Virtual Directories (Applications) in IIS

Virtual Directories - Applications
Virtual directories and applications serve similar functions in IIS. Both terms are sometimes used interchangeably.

It is only since IIS 7 that virtual directories and applications have been separate objects.
For detailed information on this topic, see the following link: Understanding Sites, Applications, and Virtual Directories on IIS 7

The term "virtual directory" is used in the following sections. In this context, he is referring specifically to applications. These are displayed in IIS with the following icon:

You cannot use virtual directories in Intrexx. Instead, you need to use websites.

When configuring IIS, please note the following:

HTTPS

  • Access via HTTPS only

  • Redirect from HTTP to HTTPS

What are virtual directories in IIS?

Up to and including Intrexx 19.03, you could use virtual directories in IIS to specify the URL under which your portal could be accessed in a browser. The virtual directory was typically created under the "Default Web Site" in IIS.

You could then access the portal in your browser by entering your domain and the virtual directory.

Example

Your domain (hostname)

exampledomain.com

Portal Name (in the portal properties)

exampleportal

Virtual Directory Name / Alias

exampleportal

URL

https://exampledomain.com/exampleportal/

You could use different virtual directories to run multiple portals with the same domain or hostname.
The corresponding URLs looked like this, for example:

URL

https://exampledomain.com/exampleportal-1/

URL

https://exampledomain.com/exampleportal-2/

URL

https://exampledomain.com/exampleportal-3/

What are websites in IIS?

In IIS, websites associated with your portal's URL serve a similar function to virtual directories.
When setting up a website in IIS, enter the URL in the "Hostname" field that will be used to access your portal in a browser.

The website is displayed in IIS in the left navigation pane as follows:

To access the portal in your browser, enter the host name in IIS and your domain.

Example

Your domain (hostname)

exampledomain.com

Portal Name (in the portal properties)

exampleportal

Host Name in IIS

exampleportal.exampledomain.com

URL

https://exampleportal.exampledomain.com

A key difference between using virtual directories and websites when deploying multiple portals is that you must create a separate website in IIS for each portal.
The corresponding URLs will then look like this:

URL

https://exampleportal1.exampledomain.com

URL

https://exampleportal2.exampledomain.com

URL

https://exampleportal3.exampledomain.com

What are the benefits of websites?

  • The use of websites is future-proof in terms of security. The ever-increasing security requirements for web applications can only be met through websites.

  • The use of virtual directories can already lead to security issues today if multiple web applications are hosted under the same website (Same-Origin Policy).

  • Using virtual directories can cause errors if multiple Intrexx portals are hosted under the same website.

  • Virtual directories complicate the configuration of front-end web servers and web connectors and increase the likelihood of errors.

  • URLs in the form of "https://exampleportal.exampledomain.com" are now considered standard (as opposed to "https://exampledomain.com/exampleportal/").

Here's how to switch from existing virtual directories to websites.

  1. Create a separate website for each virtual directory (Add a Website in IIS).

    For your own website, apply the binding settings from the Default Web Site.

  2. Close the default web page.

    To ensure that your links that still point to virtual directories continue to work, we recommend creating one or more redirect rules in the URL Rewrite module in IIS.

In the following section, you'll find detailed instructions for setting up a redirect rule in IIS.
If necessary, also consult the IIS online help at https://www.iis.net/.

Step-by-Step

To set up a redirect rule in IIS from a URL with a virtual directory to a URL with a website, follow these steps:

  1. Start IIS.

    Make sure the top entry is selected (the one below "Homepage").

  2. Click the "URL Rewrite" icon.

  3. Click "Open Feature."

    (Alternatively, you can double-click the "URL Rewrite" icon.)

    You will be taken to the "URL Rewrite" page.

  4. In the right-hand navigation pane, click "Add Rule(s)...".

    The "Add Rule(s)" dialog box appears.

  5. Click "Empty Rule."

  6. Click "OK."

    You will be taken to the "Edit Incoming Rule" page.

    The main input fields for setting up a redirect from a virtual directory to a website are the "Pattern" and " Rewrite URL" fields.

    Name

    Enter a name for the redirection rule here.

    Requested URL

    Select the option "Matches the pattern" here.

    Using

    Select "Regular Expressions" here.

    Pattern

    Enter the name of the virtual directory here, followed by a backslash.

    Test Sample (Test Sample)

    You can use this button to test the redirect.

    Ignore case

    Select this checkbox.

    Terms and Conditions

    Check the IIS Online Help to see if you should use conditions, if applicable.

    Server Variables

    Check the IIS Online Help to see if you should use server variables.

    Action Type

    Select "Redirect" here.

    Redirect URL

    Enter the URL of your portal here, followed by a backslash.

    Append query string

    Select this checkbox.

    Reroute Type

    Select the value "Permanent (301)" here.

  7. In the right-hand navigation pane, click "Apply."

    You will be taken back to the "URL Rewrite" page.

    The previously created rerouting rule is displayed.

    You have set up a redirect rule in IIS from the URL with the virtual directory to the URL with a website.