IIS supports Folder redirection via Symlink or Shortcut mechanism

Using Mklink utility you create a folder symlink that internally operates like a shortcut as shown below:

C:>mklink /D www "C:inetpubwwwroot"
symbolic link created for www <<===>> C:inetpubwwwroot

C:>

image

<p>&#160;</p>  <p>&#160;</p>  <p>Using Linkd utility, you create a symlink that redirects the C:WWW folder to &quot;C:inetpubwwwroot&quot;:</p>  <p>&#160;</p>  <p>C:&gt;linkd www &quot;C:inetpubwwwroot&quot;   <br />Link created at: www</p>  <p>C:&gt;linkd www   <br />Source&#160; www is linked to    <br />C:inetpubwwwroot</p>  <p>C:&gt;   <br /></p>  <p><strong></strong></p>  <p>C:&gt;dir &quot;C:inetpubwwwroot&quot;   <br /> Volume in drive C has no label.    <br /> Volume Serial Number is CC0C-B792</p>  <p> Directory of C:inetpubwwwroot</p>  <p>03/28/2012&#160; 03:05 PM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .   <br />03/28/2012&#160; 03:05 PM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ..    <br />02/01/2012&#160; 10:24 AM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; aspnet_client    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 File(s)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 bytes    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3 Dir(s)&#160; 74,280,931,328 bytes free</p>  <p>C:&gt;dir www   <br /> Volume in drive C has no label.    <br /> Volume Serial Number is CC0C-B792</p>  <p> Directory of C:www</p>  <p>03/28/2012&#160; 03:05 PM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .   <br />03/28/2012&#160; 03:05 PM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ..    <br />02/01/2012&#160; 10:24 AM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; aspnet_client    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 File(s)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 bytes    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3 Dir(s)&#160; 74,280,931,328 bytes free</p>  <p>C:&gt;</p>  <p>&#160;</p>  <p><a href="http://gunnalag.files.wordpress.com/2012/03/image48.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://gunnalag.files.wordpress.com/2012/03/image_thumb48.png" width="452" height="664" /></a></p>  <p>&#160;</p>  <p>You publish an IIS application to run out the symlink folder as shown below:</p>  <p><a href="http://gunnalag.files.wordpress.com/2012/03/image49.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://gunnalag.files.wordpress.com/2012/03/image_thumb49.png" width="456" height="319" /></a></p>  <p>Say you name the application as www and then if you browse <a title="http://localhost/www/" href="http://localhost/www/">http://localhost/www/</a> on your system it will work.&#160; This works since IIS call to the Physical path folder which is a symlink gets redirected to the actual physical location on the system.</p>  <p>&#160;</p>  <p><a href="http://gunnalag.files.wordpress.com/2012/03/image50.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://gunnalag.files.wordpress.com/2012/03/image_thumb50.png" width="600" height="319" /></a></p>  <p>&#160;</p>  <p>Thus, IIS works with folder redirection via Symlinking.

Leave a Reply

Your email address will not be published. Required fields are marked *