How to hide subfolder from url addresses on IIS (RewriteRule)?
<p>I am trying to remove <strong>/frontend/web</strong> and <strong>/backend/web</strong> from URL on a windows server using <strong>IIS</strong> and <strong>web.config</strong> as an alternative to <strong>.htaccess</strong></p>

<p>Original <strong>.htaccess</strong> file that I need to convert to <strong>web.config</strong>:</p>

<pre><code>Options FollowSymlinks
RewriteEngine on
RewriteRule ^admin(.+)?$ backend/web/$1 [L,PT]
RewriteRule ^(.*)$ frontend/web/$1 [L]
</code></pre>

<p>I was able to remove the <strong>/frontend/web</strong> only using <strong>web.config</strong> like so:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;configuration&gt;
    &lt;system.webServer&gt;
        &lt;rewrite&gt;
            &lt;rules&gt;
                &lt;clear /&gt;
                &lt;rule name="RewriteRequestsToPublic" stopProcessing="true"&gt;
                    &lt;match url="^(.*)$" /&gt;
                    &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt;
                    &lt;/conditions&gt;
                    &lt;action type="Rewrite" url="frontend/web/index.php/{R:0}" /&gt;
                &lt;/rule&gt;
            &lt;/rules&gt;
        &lt;/rewrite&gt;
    &lt;/system.webServer&gt;
&lt;/configuration&gt;
</code></pre>

<p>This created a problem that now all images, css and JS files are no longer loaded, they all give <strong>404</strong></p>

<p>Also this doesn't fix my problem when with <strong>/backend/web</strong> as this is suppose to Rewrite any url that contains <strong>admin</strong> to it.</p>