How to Change the www root directory on WampServer

For wamp 2.5 on Windows, use a text editor, e.g. notepad++ to edit c:\wamp\bin\apache\apache2.4.9\conf\httpd.conf

  1. Change DocumentRoot "c:/wamp/www" to DocumentRoot "c:/my/new/path" (Note slash direction). This will change the location where files are served from (~Line 230).
  2. Change <Directory "c:/wamp/www"> to <Directory "c:/my/new/path"> (Note slash direction). This applies permissions from the old directory to the new one (~Line 252).
  3. Copy all content from c:\wamp\www to your new directory (c:\my\new\path), including index.php
  4. Edit c:\my\new\path\index.php and change line 40 $server_dir = "../"; to $server_dir = "C:/wamp/"; This changes the location where config files etc. for wamp are read from. Change $suppress_localhost = false; to correct projects links (~Line 30).

Edit the httpd.conf file and/or the vhosts.conf file for the site wish to change. The Directory directive will let you specify where the files for this site are to be located.

For more info on httpd.conf see:

And specifically:

  1. Click on Green Wamp Icon (Taskbar right Notification Icons) > Apache > httpd.conf > Replace all ${INSTALL_DIR}/www with your directory. Take care to use / instead of \
  2. Click on Green Wamp Icon > Apache > httpd-vhosts.conf > Replace again the existing "www"-Directory with yours
  3. Click on Green Wamp Icon > "Restart All Services"

(Tested on Windows 10, Wampserver 3.0.6 64 Bit)