How to Change the www root directory on WampServer 2.5

How to Change the www root directory on WampServer 2.5

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Changing the WAMP www Root on Windows

By default, WampServer 2.x expects your application code to reside in C:\wamp\www. While moving projects to a drive like D:\sites is straightforward for raw file access, simply copying files there breaks the internal logic of the WampTray and the Apache configuration. You will notice that projects in the new location do not appear in the project list within the WampTray interface, and virtual hosts may fail to resolve correctly if their DocumentRoot still points to the default path.

To resolve this without relying on overly complex documentation procedures or outdated StackOverflow answers that don't account for the specific version of Apache included with WampServer 2.5, you need to manually update the Apache configuration files and adjust how WampTray discovers your sites.

Editing Apache Configuration Files

The core issue lies in the httpd.conf file located at C:\wamp\bin\apache\Apache2.4.x-conf. This file contains the default virtual host definitions and directives that tell Apache where to look for content.

Open this file in a text editor with administrator privileges. You must locate the <VirtualHost *:80> block. Inside this block, you will find a directive defining the default root:

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www"
    <Directory "C:/wamp/www">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

To switch to your new directory, update the DocumentRoot directive. Note that Apache on Windows often prefers forward slashes (/) even when using Windows paths:

<VirtualHost *:80>
    DocumentRoot "D:/sites"
    <Directory "D:/sites">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Changing the path is not enough. You must also ensure that the <Directory> block matches the new location exactly. If you leave the <Directory> path pointing to C:/wamp/www, Apache will reject requests for the default site because it cannot find files in the specified directory, even if they exist elsewhere.

After making these changes, you must restart the Apache service via the WampTray icon to apply the configuration.

Registering Custom Projects with WampTray

Updating httpd.conf handles the web server's ability to serve files, but it does not automatically populate the project list in the WampTray interface. The tray application scans specific directories by default. To make your projects visible and manageable from the toolbar:

  1. Navigate to C:\wamp\www.
  2. Create a subfolder named custom (or any name you prefer, but custom is standard for user-added projects).
  3. Move or symlink your existing projects from D:\sites into this new folder if you want them managed by WampTray, or add entries to the wamp.conf file located at C:\wamp\www.

However, a more robust approach if you strictly want to keep files on D: and just see them in the list is to edit the wamp.conf file. This configuration file resides at C:\wamp\www. Add an entry for your new directory structure there. For example:

[project]
name = MySite
root = D:/sites/MySite

This tells WampTray that a project exists at that specific path, even if the parent folder is not C:\wamp\www. This separation of concerns allows you to keep your development environment clean on the C: drive while storing heavy assets or larger repositories on a secondary partition.

Virtual Host Considerations

If you are running multiple sites, ensure that any custom virtual host definitions in httpd.conf also reflect the new paths. A common pitfall is defining a virtual host for localhost pointing to an old path while trying to serve a new site from the new directory. Apache will return a 403 Forbidden or 404 Not Found error if the DocumentRoot and the <Directory> permissions do not align perfectly with the actual file system location.

Always verify that Require all granted is present inside the <Directory> block corresponding to your new root. Without this, Apache defaults to denying access for security reasons, effectively blocking your local development environment.

For advanced users working with frameworks like Laravel, keeping code separate from the installation directory is a best practice. If you are deploying Laravel applications, consider using symbolic links (junctions on Windows) to map C:\wamp\www\project to D:\sites\project. This maintains the clean URL structure expected by .htaccess files while storing data on your preferred drive.

Our network