# Apache, Alias per vhost. [SOLVED]

## PietdeBoer

Hi guys,

I have this rule configured in my apache config:

```
Alias /Microsoft-Server-ActiveSync /var/www/z-push/index.php
```

Now i realised some vhosts in my configuration, and i want to get the Alias to work on every vhost, example:

www.test1.com/Microsoft-Server-ActiveSync should go to /var/www/test1.com/z-push/index.php

www.test2.com/Microsoft-Server-ActiveSync should go to /var/www/test2.com/z-push/index.php

and so on.

Since the Alias directive is now global on my apache config, can i enable it per vhost?

Thx in advance!

----------

## VinzC

 *PietdeBoer wrote:*   

> Since the Alias directive is now global on my apache config, can i enable it per vhost?

 

Instead of a global directive,

use Apache macros

use an include file

use ServerAliases.That depends on whether your virtual hosts all share the same code or not. In the former case, RewriteCond + RewriteRule may help:

```
RewriteCond %{HTTP_HOST} "www.(test1.com|test2.com)"

RewriteRule ^/Microsoft-Server-ActiveSync$ /var/www/%1/z-push/index.php 
```

In the latter case the include file might fit best.

----------

## PietdeBoer

thx, one alias per vhost worked!

----------

