Symlink created with mklink not working with IIS7.5 — Windows 7

随声附和 提交于 2019-12-01 06:19:06

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/13829909/symlink-created-with-mklink-not-working-with-iis7-5-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!