Search code examples
phpwampwampserver

How to Change the www root directory on WampServer 2.5


My need is to change the default sites directory of wamp from say "c:\wamp\www" to say "d:\sites". Right now my projects in "d:\sites" do not show in the project list:

enter image description here

I found a few past answers like this one and this one which I think are not applicable to WampServer 2.5 (anyway, it did not work for me).

I also found this procedure in the documentation, but it seems far too complex for what I need.

Any help on this matter would be appreciated.


Solution

  • In newer version of wamp, changing DocumentRoot in httpd.conf did not change DOCUMENT_ROOT. Even after restarting, it stayed as "c:/wamp64/www/".

    Instead, the DocumentRoot is set in this file:

      c:\wamp64\bin\apache\apache2.4.18\conf\extra\httpd-vhosts.conf
    

    To change the localhost directory, change these to your path:

          DocumentRoot c:/www
          <Directory  "c:/www/">