# Domain "parking" and VirtualHosts

**URL:** <https://community.localwp.com/t/domain-parking-and-virtualhosts/44181>\
**Category:** Support\
**Created:** [August 16, 2024, 4:59pm UTC](https://community.localwp.com/t/domain-parking-and-virtualhosts/44181 "2024-08-16T16:59:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blinkcursor](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/blinkcursor/32/5844_2.png) [@blinkcursor](https://community.localwp.com/u/blinkcursor)\
**Post date:** [August 16, 2024, 4:59pm UTC](https://community.localwp.com/t/domain-parking-and-virtualhosts/44181/1 "2024-08-16T16:59:34Z")

</div>

### What issue or error are you experiencing?

I’m transitioning from MAMP (MacOS) where I can do this straightforwardly, but it doesn’t work on Local (which is otherwise far superior).

Because reasons, I need a local environment that mirrors parking domains on a web host, so that I have several domains or sub-domains pointing to the same local folder, e.g.

mydomain.local  
subsite.mydomain.local  
alt.mydomain.local

all point to the same Local Sites folder, and when you visit those urls they display the same site, and _the urls do not change_.

Based on how I do this in MAMP, I have edited the etc/hosts file so that each of those domains map to 127.0.0.1

For the site I have created in Local I have switched to using Apache (same set up as MAMP) and I have edited the file conf/apache/apache2.conf.hbs and added the following:

```auto
<VirtualHost *:80>
    DocumentRoot "/Users/xxx/Local Sites/mydomains/app/public"
    ServerName mydomain.local
    ServerAlias subsite.mydomain.local alt.mydomain.local
</VirtualHost>

```

It _nearly_ works, visiting any of the URLs does show the site content, _but the url updates to the main url_, the subdomains are redirecting to the main domain.

What else would be needed for this to work with Local?

## I’m not averse to changing to use nginx rather than Apache if that helps.

### System Details

- **Local Version:**  
Version 9.0.5+6706

- **Operating System (OS) and OS version:**  
MacOS Sonoma Version 14.5 (23F79)

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [August 27, 2024, 4:58pm UTC](https://community.localwp.com/t/domain-parking-and-virtualhosts/44181/2 "2024-08-27T16:58:01Z")

</div>

Hi @blinkcursor

I’m not sure I’m following exactly but are you essentially trying to build a multisite with the domains?

> **[Multisite with Local](https://localwp.com/help-docs/advanced/wordpress-multisite-with-local/)**
>
> Developing WordPress multisites can be hard. Here are some tips for working with WordPress multisites in Local.

Or you might be thinking more like this recent feature request:

> [@Enable multiple domain names to access single Local site](https://community.localwp.com/t/enable-multiple-domain-names-to-access-single-local-site/44156):
>
> It would be useful to be able to use multiple domain names to access a single Local site. In my instance, I am using the WordPress plugin “Polylang” to enable multiple language versions of a site I am developing, and wish to utilise Polylang’s facility to serve different language versions of my site on different domain names (as this is how the site will work once live). Alas, Local does not enable me to serve a single Local site via different domain names. Perhaps a UI could exist within the …

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [November 25, 2024, 4:58pm UTC](https://community.localwp.com/t/domain-parking-and-virtualhosts/44181/3 "2024-11-25T16:58:18Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
