Use websites instead of virtual directories in IIS
Virtual directories - Applications
Virtual directories and applications have similar functions in IIS. Both terms are sometimes used interchangeably.
Virtual directories and applications have only been separate objects since IIS 7.
You can find detailed information on this under the following link: Understanding Sites, Applications, and Virtual Directories on IIS 7
In the following sections, the term virtual directory is used. In the narrower sense, it refers to applications. These are represented by the following icon in IIS:
You cannot use virtual directories in Intrexx. You must use websites instead.
What are virtual directories in IIS?
Up to and including Intrexx 19.03, you could use virtual directories in IIS to define the URL that is used to reach the portal in the browser. The virtual directory is usually created below the "Default Web Site" in the IIS.
In the browser, you could then access your portal by entering your domain and the virtual directory.
Example
Your domain (host name) |
exampledomain.com |
Portal name (in the portal properties) |
exampleportal |
Name of the virtual directory / alias |
exampleportal |
URL |
https://exampledomain.com/exampleportal/ |
You could operate several portals with different virtual directories with the same domain or host name.
The corresponding URLs could look 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 IIS?
In IIS, websites fulfill a similar function to virtual directories in connection with the URL of your portal.
When creating a website in the IIS, you specify the URL under which your portal is called up in the browser in the "Hostname" field.
The website looks like this in the navigation area on the left of IIS:
You can access the portal in the browser by entering the host name defined here and your domain.
Example
Your domain (host name) |
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 the use of virtual directories and websites when using multiple portals is that you have to create a separate website in the IIS for each portal.
The corresponding URLs look like this:
URL |
https://exampleportal1.exampledomain.com |
URL |
https://exampleportal2.exampledomain.com |
URL |
https://exampleportal3.exampledomain.com |
What are the advantages of websites?
-
The use of websites is future-proof in terms of security. The constantly growing security requirements for web applications can only be met by websites.
-
The use of virtual directories can already lead to security problems if several web applications are hosted on the same website(same-origin policy).
-
The use of virtual directories can lead to errors if several Intrexx portals are hosted on the same website.
-
Virtual directories make it more difficult to configure front-end web servers and web connectors and are very prone to errors.
-
URLs in the form of "https://exampleportal.exampledomain.com" are now considered commonplace (in contrast to "https://exampledomain.com/exampleportal/").
How to switch from existing virtual directories to websites.
-
Create a separate website for each virtual directory(Add website in IIS).
Apply the binding settings from the Default Web Site to your new site.
-
Stop the Default Web Site.
You that your links that refer to virtual directories continue to work correctly, we recommend that you add one or more redirect rules in the URL rewrite module in ISS.
In the following section you will find detailed instructions for setting up a redirection rule in IIS.
If required, please also consult the IIS online help https://www.iis.net/.
Step-by-step guide
To configure a redirect rule for a URL with a virtual directory to a URL with a website, please proceed as follows:
-
Start IIS.
Make sure that the top entry (below "Start page") is highlighted
-
Click on the "URL Rewrite" icon.
-
Click on "Open feature".
(Alternatively, you can also double-click on the "URL Rewrite" icon)
This takes you to the "URL Rewrite" page.
-
Click on "Add rule(s)..." in the right-hand navigation area.
The "Add rule(s)" dialog box is displayed.
-
Click on "Empty rule".
-
Click on "OK".
The "Edit incoming rule" page appears.
The central input fields for setting up the redirection 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 value "Corresponds to pattern" here.
Using
Select the value "Regular expressions" here.
Sample
Enter the name of the virtual directory with a trailing backslash here.
Test pattern
This button allows you to test the redirection.
Ignore upper/lower case
Select this checkbox.
Conditions
Refer to the IIS online help to find out whether you should use conditions.
Server variables
Refer to the IIS online help to find out whether you should use server variables.
Action type
Select the "Redirect" value here.
Redirect URL
Enter the URL of your portal here with a trailing backslash.
Append query string
Select this checkbox.
Redirection type
Select the value "Permanent (301)" here.
-
Click on "Apply" in the right-hand navigation area.
You will return to the "URL Rewrite" page.
The rule you just created will now appear in the list.
You have now configured a redirect rule for a URL with a virtual directory to a URL with a website.