<p>If you create your folder structure like this:</p>

<pre><code>craft/
public_html/
----townsville.example.com/
--------index.php
--------.htaccess
----brisbane.example.com/
--------index.php
--------.htaccess
</code></pre>

<p>And set the <code>$craftPath</code> variable in each <code>index.php</code> like this:</p>

<pre><code>$craftPath = '../../craft';
</code></pre>

<p>It should do what you're looking for.</p>

CC BY-SA 3.0
2016-05-22T21:23:56.317Z
2016-05-22T21:23:56.317Z
Brad Bell
<p>I am trying to create two subdomain names: </p>

<ul>
<li>townsville.example.com</li>
<li>brisbane.example.com</li>
</ul>

<p>All subdomains would share the same database. They would be tied to the Pro license on example.com.</p>

<p><strong>What is the best way to achieve this?</strong></p>

<p>Do I have to copy index.php to each subdomain root folder?</p>

<templating><database><license>
Subdomain Setup
# Subdomain Setup

(Asked by: username_0 on 2016-05-21)

I am trying to create two subdomain names:

* townsville.example.com
* brisbane.example.com

All subdomains would share the same database. They would be tied to the Pro license on example.com.

**What is the best way to achieve this?**

Do I have to copy index.php to each subdomain root folder?

**Tags:** templating, database, license


---

## 1 answers

### Answer by username_1 on 2016-05-22. Score: 3

If you create your folder structure like this:
craft/
public_html/
----townsville.example.com/
--------index.php
--------.htaccess
----brisbane.example.com/
--------index.php
--------.htaccess

And set the $craftPath variable in each index.php like this:
$craftPath = '../../craft';

It should do what you're looking for.


---

