Bluehost Automatic Sub-domain Creation - automation

I am working on a small project in which people create an account and they are given a sub-domain like username.mydomain.com
However, while this address is shown in the address bar of the browser, the page actually exists at something like mydomain.com/?profile=12345.
The sub-domain would be created automatically just like deviantart
Is this possible with a standard Bluehost account running cPanel?

Related

Is there a way to way to control which CNAME gets what content?

My ultimate goal is to have free plan cname content, and premium plan cname content.
For example if someone has a cname of free.example.com set to my website I'd like to show them a specific page, and if premium.example.com I want to show them another page. Finally, I'd like to know if there is a way to add new cnames to my list so that I can have them view a certain page?
Just to make this more understandable this, I want to do something like https://www.gitbook.com/ do with their cnames, and cname serving.
You'll have to use the Host header from the user's request to identify which subdomain or cname they're visiting, and then showing them the desired content. If the subdomain such as free and premium are fixed, you could use Nginx server blocks or Apache virtual hosts to direct the user to specific application or application URI.
Likewise, you can get the Host header with req.hostname in Express. Based on the host, you can route the user to the desired content. You can add as much subdomains or cnames you wish and let your application control the content for the user based on the host. If your DNS host has an API (such as Cloudflare), you can add your subdomains programmatically, or you could do a wildcard subdomain to accept any subdomain.

How to setup domain routing for a CakePHP and Apache website builder?

I have a CakePHP website that is designed to let users generate their own simple 1-4 page sites.
The idea is that people go to app.example.com (where the website is hosted), create an account, and generate their website.
After generation, their website gets an ID (I have this setup as a UUID instead of a sequential counter).
Currently, users can access their websites by going to example.com/websites/{PAGE}/{WEBSITE ID}
I want to reformat that into {WEBSITE ID}.example.com/{PAGE}.
I am running all of this on a Linux server with apache, and my plan would be to use some form of wildcard DNS record for all subdomains. Users would not be expected to use their UUID subdomains for their website, but they would instead be expected to purchase a domain and setup a CNAME record.
My initial thought would be that this would somehow be done with apache, but I am not sure.
Any help or advice would be appreciated.

main domain in cpanel different from actual website domain

When i log in to CPanel the main domain it shows on the first page and even when creating email accounts is different from the actual website domain.
The domain cpanel is showing is actually an older domain i created earlier but due to a mistake in the name, I registered another domain and moved all the content of the older site to the newer one. The newer site works perfectly but the issue i face now is that within cpanel i'm not able to do some things like create emails because it is showing a different domain name.
Actual domain is hanjakprofessionals.com
My web host claims he never did anything other than create for me a new domain account.
i assume that the problem could be in the way i migrated from the older site, however, i can't undo because I've made many changes in the newer site.
I noticed that some folders in cpanel like in mail folder and etc, their name is the older domain name which i edited to the newer but still no difference.
Is there anywhere i can change within cpanel to enable it reflect the current domain name? I welcome all ideas. thanks
on further checking i found that the cpanel user account i was using was of the older domain account so cpanel was actually loading the older account. I now logged in using the user account for that particular domain and it shows the actual domain in cpanel.
This is now resolved however i notice that cpanel allows one to login to another domain account yet the domain/url that was accessed was a different one.

CPanel redirection addon domain

I have a wildcard subdomain setup using CPanel, and I'd like to be able to add domain that will be linked to a subdomain without the usual redirection.
So when the user go to "test1.com", I'd like him to see exactly the same as test1.mysite.com, but I want the URL in the browser to remain test1.com, test1.com/page2.html, etc..
I don't want to use Iframe.
Any solution ?
That's simple if both test1.com and test1.mysite.com are on the same cpanel account.
Click on Subdomains link in cPanel Home.
In Subdomain: field, type test1 and select mysite.com.
In the field Document Root:, type the path of the directory to which test1.com points.
Click create.
test1.mysite.com is now same as test1.com.
Hope that helps
Login to cpanel and Subdomains, in Subdomain field type your subdomain name like "demo " and choose the domain name.
In cpanel server put the Document Root: "public_html/demo"it come automatically and Click create.
And upload your files in above path public_html/demo to access your subdomain live.

Whats the technology behind sites like (Google Sites, Shoppify etc)?

I am wondering how sites like Google sites and shopify allow customers to create a website and then link it to their own domain?. Google sites allow a user to create their own website, at a user supplied domain, and shopify allows a user to create their own e-commerce site - once again, they can supply their own domain to be used to access the webshop created.
In both cases, the website is ostensibly accesed by typing the users domain name in the browser, although the website is actually being hosted by a third party company (Google, Shopify etc)
How is this possible?. Does anyone have an insight into how this is (likely) being done?
I imagine that the technology is DNS, or more precisely CNAME records which alias one DNS name (e.g. "vole-strangling.com") to another (e.g. "vole-strangling.sites.google.com").
Subdomain RewriteRule
why dont you use mod_rewrite rules to do the trick
http://forums.digitalpoint.com/showthread.php?t=33868