Author: Edit Olah

Setting up multiple projects in WAMP 3 with aliases

Local development environment

When you have to set up a development environment quickly on a Windows machine WAMP is a good option as installing and configuring it is a breeze. Let’s have a look at how to establish a multiple-project structure in WampServer 3.

1. Download WAMP onto your machine.

Download WampServer and follow the instructions provided on wampserver.com for installation.

In this article we are working with WAMP 3 - WAMPSERVER (64 BITS & PHP 5.6 & PHP 7) 3.

As of 01.08.2016, the package includes:

64 bit WampServer 3.0.4:

  • Apache 2.4.18
  • PHP 5.6.19/7.0.4
  • MySQL 5.7.11

Operating system: Windows 10

System type: 64-bit

By default it creates a ‘wamp64’ directory in your Windows root:
C:\wamp64

2. Setting up multiple projects in WampServer 3.

The root folder is 'www’ inside the ‘wamp64’ directory (C:\wamp64\www). This is where you can set up multiple directories for your projects. These directories inside ‘www’ are going to be your project root directories. Let’s name our test directory ‘mydirectory’.

Contents of the www directory in WampServer - screenshot.

3. Assign aliases to your projects.

Make sure Wamp3 is running.

Open up the WAMP popup menu by left clicking on the WAMP icon in your systems tray in the bottom-right corner and navigate to ‘Apache’ > ‘Alias directories’, and click on ‘Add alias’.

WampServer menu - navigating to Add an alias - screenshot.

A command prompt window will open up:

WampServer Apache - console screenshot.

Specify the alias that you would like to use without any single quotes and press 'Enter'. (This will be between the last two slashes of your new local URL: 'http://localhost/mydemodomain/'.

WampServer Apache - console - enter alias - screenshot.

Enter the destination path as an absolute path to your project root directory such as 'c:/wamp64/www/mydirectory/' and hit 'Enter'. WAMP will confirm that your alias has been created.

WampServer Apache - console - enter destination path - screenshot.

Hit 'Enter' again to close the window. WAMP will restart itself.

WampServer Apache - console - alias created - screenshot.

You should see the WAMP icon changing colours. When it is back to green again, you are good to go.

WampServer icon changing colour - screenshot.

You should see your new alias in the list under the ‘Alias directories’ menu item in WAMP’s popup navigation.

WampServer menu - Alias directories - screenshot.

Use your new URL in your chosen browser, 'http://localhost/mydemodomain/', and visit your site that you have just set up locally. You can also click on ‘Localhost’ in the top of WAMP’s popup navigation that takes you to a dashboard and all your aliases will be listed under ‘Your aliases’ in this page with clickable links that will take you to the URLs you specify.

WampServer menu - Localhost - screenshot.

When ERRORs happen

If you haven’t created the directory yet, or you have misspelled something in the path, it will complain and let you know that the alias hasn’t been created.

WampServer Apache - console - directory doesn't exist error message - screenshot.

- ! TIP ! -

If you can’t access your new site, check if you have at least the default ‘index.php’ that comes with WAMP copied into your project root; or you might want to check the permissions assigned to the files and folders in your project root. Windows can get playful with those!

How to delete an alias

Open up the WAMP popup menu by left clicking on the WAMP icon in your systems tray in the bottom-right corner, and navigate to ‘Apache’ > ‘Alias directories’ > alias in question. Click on the little triangle on the right to access the list of actions you are offered to execute on the alias by WAMP. You have the options of editing the alias, editing the '.htaccess' file, and suppressing the alias.

To delete the alias, click on ‘Suppress alias’.

WampServer menu - Suppress alias - screenshot.

A command prompt window will open up and ask you if you are sure. Type the word ‘yes’ to delete the alias.

WampServer Apache - console - Type yes to confirm - screenshot.

It will celebrate with a confirmation of the alias being deleted. Hit ‘Enter’ to close the window.

WampServer Apache - console - Alias deleted - screenshot.

Resources:

WampServer: http://www.wampserver.com/en/

Related blog posts

  • How to export MySQL database into a ‘.sql’ file on WAMP

    How to export MySQL database into a ‘.sql’ file on WAMP

    MySQL dump in Windows command prompt

    If you are used to Linux/Unix based environments using the command line...

    More details >>

  • My often used MySQL commands

    My often used MySQL commands

    Basic MySQL commands

    Basic commands for managing databases in MySQL on the command-line in local...

    More details >>

  • ‘mysqldump Version Mismatch’ warning from MySQL Workbench

    ‘mysqldump Version Mismatch’ warning from MySQL Workbench

    Changing the path to mysqldump program file

    How to make sure that the mysqldump.exe version of MySQL Workbench is equal...

    More details >>

Contact Edit

Get in touch

If you are interested in hiring me, please drop me an email. I would be happy to send you my up-to-date resume.

Drupal Association member
Image of Edit