Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

How can i change the root directory of the currently installed wampserver to some other directory.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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: http://httpd.apache.org/docs/2.2/configuring.html

And specifically: http://httpd.apache.org/docs/2.2/mod/core.html#directory

share|improve this answer

After doing the above, you can also change the: in the of wamp directory (wampmanager.ini, wampmanager.conf).

php.ini my.ini

Save your changes and close Wampserver.

share|improve this answer
I tried doing this, but found that it got overwritten upon wamp restart. You can fix it for good by editing the $wwwDir variable in wamp/scripts/config.inc.php –  Kevin Higgins Feb 6 '14 at 20:08

I found these simple steps helping,

  1. Click on WampServer icon in taskbar

  2. Select Apache > httpd.conf from the pullup

  3. Search for the term “DocumentRoot”

  4. Change the DocumentRoot path to your custom directory

  5. Search again for “DocumentRoot”

  6. again same procedure

  7. Save your changes and “Restart All Services”

share|improve this answer
I have tried that but I get the Permission denied when I try to surf to localhost –  user44905 Sep 20 '14 at 9:35
@Max did you check whether there is any htaccess file in your new directory or project –  Prasanth K C Sep 21 '14 at 8:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.