Archive for 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, by default it would link to target file

[virtualDirectoryName] is the name of the virtual directory in the wamp/www folder

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

For example, if I want to create a site using name ‘mysite’ and I want to link this virtual directory to the directory ‘d:\somefolder\sitecontent’, then, assuming the location of wamp as ‘c:\wamp\www’, I 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 directories in wamp so that you would not have to put all the content into wamp/www directory.

Comments (4)