Enforce embed in TARGIT Anywhere

Default or embed?

TARGIT Anywhere has two different modes, "default" and "embed".

As the name implies, default is the standard behavior. 

With default you see the toolbar in the top of your browser, that allow the user to navigate into Shared folders and other more advanced features.


A standard URL could look like this:




If you want to simplify the use of TARGIT or embed TARGIT into other applications, you might want to hide the toolbar.

You can hide the toolbar by adding "embed" to the URL:


Enforce embed through IIS configuration

If you want to enforce embed to your TARGIT Anywhere deployment, you can use the "IIS URL Rewrite 2.1" module for Internet Information Server (IIS).

The module can be downloaded from here:

IIS URL Rewrite 2.1

Adding rules to web.config

To apply the rules, you need to edit web.config for TARGIT Anywhere. The "web.config" file is typically found here:


Under the existing tag <system.webServer> you add the rewrite part as seen here:

<rule name="embedRedirect" stopProcessing="true">
<match url="^$" />
<add input="{REQUEST_URI}" pattern="^/$" />
<action type="Redirect" url="/embed" />

TARGIT version before TARGIT 2023:

<rule name="default" stopProcessing="true">
<match url="default$" />
<action type="Redirect" url="embed" />
<rule name="anywhere/" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^/?$" />
<action type="Redirect" url="embed" />

If you don't have <system.webServer> in you web.config file, you simple add <system.webServer> inside the <configuration> tag.

Note: Web.config is overwritten with every upgrade of TARGIT Anywhere - so you'll need to insert the <rewrite> part after upgrading TARGIT Anywhere. 


You can see the result of an enforced replacement of embed from these links:





Was this article helpful?
1 out of 1 found this helpful



Please sign in to leave a comment.