Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Can I have multiple subdomains working with one WordPress installation?

Hi. I'm trying to setup my website in WordPress and I need some help :P

  • I have one main WordPress installation in the www root folder: example.com
  • From the admin I can create Pages. I created one called "Motion" and the url looks like this: example.com/motion
  • Also, I registered a subdomain in my server called: motion.example.com and they told me that the content should be placed in a separated folder called "motion" located inside my www folder

As far as I know, WordPress have the page structure inside the database, not in physical folders, so I don't understand how I can make my subdomain to work. I would love to have my url looking like this: motion.example.com/demo/sample but with the admin I only can make it look like example.com/motion/demo/sample

Thanks in advance for any help

4 Answers

Derrick Lee
Derrick Lee
7,743 Points

Hello, I haven't followed the tutorials in treehouse for Wordpress development. But based on my experience, creating pages through the Wordpress admin basically only allows you to create pages under your domain.

If you want to have a sub-domain, I see three ways of doing it (I may be wrong).

  1. Using WordPress Multisite
  2. Using cPanel (If you're using an online host)
  3. Using URL rewrite (I'm just guessing)
Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Hi David,

Are you trying to manage the content in motion.example.com from within WordPress? Or is the content in the subdomain supposed to be a separate site?

Hi Zac. Actually, I know how to make it a separate site. With just another clean WordPress installation inside the motion folder. The subdomain looks inside that folder and everything should work properly. Also, this would make any subpage to look like motion.example.com/demo -This is what I want, clean URLs... but not manage two separated sites-

I need to have ONE admin area, where I can upload my main theme and all the pages looks exactly as they should. Having two WordPress installation means upload the theme twice, and making changes twice and so on. I heard about WordPress Multisite but I don't understand the concept really well :S

I know the SEO drawbacks of having subdomains, but example.com is my personal site, I want to keep it clean and running my portfolio and my blog. motion.example.com & themes.example.com (another subdomain I have created) will be used for display live demos of Motion Graphics templates and also WordPress themes filled with dummy content. So I need to keep them separate from the main site.

PD. The WordPress course is awesome! I'm learning so much with them and everything start to make sense inside the WordPress world. Keep it up my friend :D

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Okay, so running two different sites from one install isn't possible. If you're trying to share continent and themes, WP multisite is the way to go.

It shouldn't take you long to figure it out :) We have an intro to it on the blog that you might find helpful: http://blog.teamtreehouse.com/getting-started-with-wordpress-multisite