Symlink created with mklink not working with IIS7.5 -- Windows 7
Asked Answered
E

2

6

So while in my IIS root directory (c:\inetpub\wwwroot) I've created a symlink to a network drive using:

mdlink /D truthuniversal "U:\Truth Universal Full Site\public"

The symlink was created just fine, and if I issue the cd truthuniversal command, while in the IIS root dir, I do indeed end up in the "U:\Truth Universal Full Site\public" directory area.

My problem is that when I type:

http://localhost/truthuniversal 

in my browser's address bar IIS does not serve the index page which resides in the public directory. Instead, I get the following error:

Server Error in Application "DEFAULT WEB SITE"

Internet Information Services 7.5 Error Summary HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Please advise.

-TU

Entomb answered 11/12, 2012 at 22:57 Comment(1)
u mean, MKLINK.exe ?Machicolation
C
12

You need to create a virtual directory mapping to that directory in IIS in order for it to serve up the page. In IIS, right click on "Default Website", then click "Add Virtual Directory". Also, doing this, there is no reason why you even need the symlink. Just map it to the target to begin with.

Codon answered 11/12, 2012 at 23:13 Comment(1)
I did that, and it works with my removable USB storage. However, it does not work on this network drive.Entomb
D
5

I agree that virtual directory in IIS may be what you want, but if you want to minimize IIS maintenance, consider this:

Instead of directory symbolic link: mklink /D
try directory junction: mklink /J

This worked for me and the web apps are able to write to the same directory.

mklink /J App_Data d:\shared\App_Data

worked for me on Windows Server 2008 R2.

Denson answered 3/8, 2018 at 20:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.