WordPress Tutorial Videos by WP101®

175+ WordPress tutorial videos for non-techies.

  • About Us
    • Top WordPress Products
    • Testimonials
  • WordPress Tutorials
    • Intro to WordPress
    • WordPress 101
    • AIOSEO 101
    • WP Mail SMTP 101
    • Easy Digital Downloads 101
    • WPCode 101
    • WP Simple Pay 101
    • RafflePress 101
    • Elementor 101
    • WPForms 101
    • Spectra 101
    • How to Blog Better
    • WooCommerce 101
    • Beaver Builder 101
    • Ninja Forms 101
    • WP Rocket 101
  • Help Forum
    • Hire a WordPress Expert
  • Blog
  • Contact
  • Sign In

Can WP load content into template based on subdomain URL?

Get answers to your WordPress questions!

Tired of wasting time scouring Google for answers to your WordPress questions? Since 2008, we've helped countless WordPress site owners just like you get unstuck. Get answers to your WordPress questions — plus unlimited access to our entire library of 150+ WordPress tutorial videos. Why not join us today?

View Membership Options
WordPress Questions and Answers › Can WP load content into template based on subdomain URL?
0 Vote Up Vote Down
C
Christian Majewski
asked 8 years ago

I have a client who has a custom site that they would like to migrate over to wordpress. The site has 7500 unique subdomains that point to one PHP template. That template pulls in content from the database based on subdomain. So on their custom build there is only 1 page that exist for the subdomains, a single template page. This page does nothing but dynamically call using the contents of the subdomain to the sql database to retrieve the list of contents that fit the requirements ( keywords, Titles, copy etc.) of the calling document. This one page is then duplicated to all the subdomains.

Is this doable in Wordpress somehow? My research tells me it is not and this is unique project - the client does not want to lose their SEO footprint. Anybody have suggestions on how to do this the best way?

Do we point the existing subdomains to WP and load in content based on that? I think that would be best, but is it doable as a redirect and in WP pages template structure?

Or should this be built as a custom CMS?

J
Janet Wall
replied 8 years ago

Have you posted this to Facebook’s WordPress Help and Share page?

1 Answers
0 Vote Up Vote Down
Shawn Hesketh answered 8 years ago

Hi Christian,

This may be possible, but it will certainly not be easy. It will likely involve using the wp_get_referer function (docs) along with a custom page template to serve the unique content for each page.

And yes, you would point the existing subdomains to the WordPress installation, and then load the unique content based on the referring URL.

Without diving into too much technical detail here, if it can be done in PHP, it can be done in WordPress. But it will definitely require custom coding. There is no theme or plugin that will do this out of the box.

The bigger quesiton is WHY? It's clear this tactic is currently being employed for some grey-hat SEO purpose. If it's working, why change it? You could just as easily run the existing PHP template on the same server as your WordPress site, then use WordPress only to create and manage the other pages and/or blog posts.

So there are likely better ways to think about this than trying to get WordPress to replace their current solution.

That's my two cents, but I've also reached out to a couple of other developers who might have better answers for you.

Hope this helps!

Please login or register to join the conversation!

Share this with someone?

FacebookTweetLinkedIn

Most Recent Questions

  • I took the Sprectra 101 course. Now I’m building my won web site but I still have the Specra Style Guide and I think it’s causing an issue with Sprectra One. How do I get rid of the Style guide? asked by Mallis01, 1 year ago
  • Can you offer any tips, or best practices, on how to redesign and upgrade an old website? asked by FSAuthor, 1 year ago
  • How to create a blog in Spectra? asked by TJ, 1 year ago
  • How do I make all the words show Uppercase? asked by iLoveToLiveWell.com, 1 year ago
  • Why does my right side dashboard top look different than course. asked by Blues1947, 1 year ago

Site Links

  • About Us
  • Your Account
  • Products We ❤️
  • Affiliates
  • Testimonials
  • Blog
  • Contact Us

Courses

  • WordPress 101
  • WooCommerce
  • Elementor
  • Spectra
  • WPForms
  • Ninja Forms
  • View All →

Products

  • WP101.com
  • WP101 Plugin
  • Embed our videos on your site!

Recent Posts

  • All in One SEO Review 2025: Pros, Cons & Real Results
  • 7 Best Small Business Web Hosting Services (Expert Picks)
  • 10 Best SEO Rank Tracking Tools: Features, Tips & Hidden Gems
  • How to Install a WordPress Theme (Complete Step-by-Step Tutorial)
  • How to Create a Donation Website in WordPress (Complete Step-by-Step Tutorial)

Connect with Us

  • Email
  • Facebook
  • Twitter

WordPress Tutorials by WP101© 2008-2025 WP101® LLC. All rights reserved.
WP101® is a registered trademark with the U.S. Patent and Trademark Office.
WP101® is hosted by SiteGround.
Privacy Policy | Terms of Use | Disclosure | WP101 Coupon