Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:51:08+00:00 2026-06-09T07:51:08+00:00

I’ve been reading previous posts but I can’t figure out what will work or

  • 0

I’ve been reading previous posts but I can’t figure out what will work or wont work with my setup so any help here is much appreciated!

For starters, I’m using the latest release of CakePHP (2.2). I’m hosting on a (gs) account w/MediaTemple.

I’ve got a site where a user can signup for an account at domain.com.

The user can access and change their info at dashboard.domain.com.

The user can view their individual information at sites.domain.com/username. The user can change the appearance of this page by selecting a theme from the database and for this, I’m using CakePHP’s theming structure. There’s one basic layout with multiple css options, so everything is pulled from the database into this one file and depending on which ‘theme’ they choose, the different css file is pulled. That all works well.

What I’d prefer is that they see their page from a wildcard subdomain(?), ie. username.domain.com instead of sites.domain.com/username.

I’d also like to give the option for them to register their own domain names, and point/redirect/something to the subdomain while still showing their unique domain in the url. I’d also like to not have to host additional domain names so can this be done w/name servers?

Any thoughts on where I go from here? Thanks in advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:51:09+00:00Added an answer on June 9, 2026 at 7:51 am

    This is a very common request, and it falls under the "Multi-tenancy" approach to web application development.

    I answered a question recently that uses this approach.

    Code

    The linked answer shows the DomainRoute that I use to support dynamic subdomains on the CakePHP side of things. This has all the code you need to handle it from that point of the project.

    The only applicaiton specific code in there, and the code you will need to change is the Cause related stuff:

    $Cause = new Cause();
    if (!($Cause->domainExists($domain) ...
    

    Cause is a Model in my application, and it has a domainExists method. This method checks to see if the passed $domain exists on any Cause (or sub-website). The implementation of domainExists is a very simple find call:

    public function domainExists($domain) {
        $causes = $this->Cause->findByDomain($domain);
        return !empty($causes);
    }
    

    If the domain does exist in the database, it adds the full domain to the $params variable.

    If the domain does not exist in the database, it does some redirection.

    DNS

    The DNS should be setup as a wildcard. The way this is done differs from provider to provider, but in ordinary BIND, its done like this:

    * CNAME domain.com.
    

    That adds a wildcard CNAME to your DNS records.

    I hope that helps. The code from the previously answered question is the most helpful, so ensure you read through that carefully first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I know there's a lot of other questions out there that deal with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.