Can Drupal be configured to find modules in other locations? I put my modules in sites/all/modules. Is there a way to configure Drupal to find more modules in other locations as well?



Edited

I use Virtual Hosts often but not in the way you described. The format I'm familiar with looks like this, and it helps me put the entire work project somewhere else not inside www. 

&lt;VirtualHost *:80&gt;
    ServerName testdrupal.com
    DocumentRoot "C:/proj/testdrupal"
    ServerAlias testdrupal.com

   &lt;Directory "C:/proj/testdrupal/"&gt;
       Options Indexes MultiViews FollowSymLinks
       AllowOverride All
       Order allow,deny
       Allow from all
   &lt;/Directory&gt;
&lt;/VirtualHost&gt;


I think what you're describing is something different, right? I'm trying to leave the drupal folder inside www as usual, but move only the sites/all/modules to another location, but I still can't figure out how the VHost entry will look like in this case. Let's say I want to move it to C:/proj/testdrupal. I hope I didn't completely misunderstand you.
Before answering, it's helpful to have a little background about how Drupal finds modules. Drupal uses a list of suggestions from the Drupal root to figure out where to find modules. In order of priority:


sites/$SITENAME/modules
sites/all/modules
profiles/$INSTALLPROFILE/modules
modules


If Drupal doesn't find a module in (1), it checks (2). If it's not there, it checks (3), and so on.

For (1), if you're just using a basic, single-site install of Drupal, $SITENAME is default. Otherwise:


In Drupal 6, $SITENAME is the host name of the site. If your site is located at example.com, $SITENAME would be example.com. 
In Drupal 7, $SITENAME is defined in sites/sites.php. If you look at example.sites.php, you can see how to define it. It's also important to note that any module listed there will only be usable for that specific sites, not all sites.


In (2), any module found there will be usable on any site in the Drupal installation. It will also be left untouched when you upgrade the core installation. This is, of course, the recommended place to put modules and likely all documentation you've read have told you to put your modules here.

(3) is used for installation profiles that require a specific module. Installation profiles are essentially a way to define a custom initial state for a Drupal site. For example, Drupal comes with two installation profiles built in: Standard, which includes most-used features, and Minimal, which only includes the bare minimum needed for a Drupal site to function.

(4) is used by Drupal core. While you can technically add modules here and they will be available for all sites, you shouldn't. Seriously. The modules folder is touched when Drupal core is updated, and will cause problems down the line if you're sticking modules you need for your site to function there.



Now that the background is out of the way, you can use file system tricks to have your modules housed outside of where Drupal looks. 

For example, you could set up a symbolic link from sites/all/modules to another directory outside of the Drupal installation:


In Unix/Linux/BSD-based systems: ln -s /path/to/modules/folder /path/to/drupal/sites/all/modules
On Windows Vista/Server 2008/7 and higher: mklink C:\path\to\drupal\sites\all\modules C:\path\to\custom\modules\folder


As far as I'm aware, there's not much you can do in earlier versions of Windows that don't have mklink.