Wednesday, May 21, 2008

Virtual Directory in WAMP using Symbolic Link

You can setup a virtual directory in WAMP using Symbolic Link. You have to create a symbolic link in Windows using following command :

mklink /D [virtualDirectoryName] [TargetDirectory]

where,

/D indicates the target is a directory and not a file. If you don’t provide this then it will take file as target by default

[virtualDirectoryName] is the name of the virtual directory

[TargetDirectory] is the target directory to which you want to link the virtual directory

For example, if you want to create a site using name ‘mysite’ and you want to link this virtual directory to the directory ‘d:\somefolder\sitecontent’, then assuming the location of wamp as ‘c:\wamp\www’ you will create symbolic link as follows :

mklink /D c:\wamp\www\mysite d:\somefolder\sitecontent

I think it would be very useful to create virtual directory in wamp so that we would not have to put all the content into www directory of wamp.

1 comment: