DNS Settings
How do you set up the server so all subdomains dns settings send you to your main domain? So, if I typed in anything.domain.com, it would send me to domain.com
How do you set up the server so all subdomains dns settings send you to your main domain? So, if I typed in anything.domain.com, it would send me to domain.com
LeahCarter posted this at 00:08 — 23rd March 2005.
They have: 15 posts
Joined: Mar 2005
Do you have your own dns server? Or are you using a webhosting console?
Thanks
Leah
Citizen posted this at 03:23 — 23rd March 2005.
They have: 8 posts
Joined: Mar 2005
I'm using a host. Basically I want the user to be able to type whatever they want as the subdomain, have the subdomain'd name assigned to a variable, and be able to have the user see a text that uses that variable in a sentence like "Hello, $subdomain, welcome to the site!"
openmind posted this at 13:13 — 23rd March 2005.
He has: 945 posts
Joined: Aug 2001
You need to set the site up on its own dedicated IP. Then add a A record with a * pointing to that IP. Finally use a bit of server side script to grab the subdomain. Not sure how you would do it in PHP but with ColdFusion you would simply do:
<cfset tAccountToProcess = ListFirst(CGI.SSERVER_NAME, ".")>
<cvoutput>Hello, #tAccountToProcess#, welcome to the site!</cfpoutput>
Citizen posted this at 03:10 — 24th March 2005.
They have: 8 posts
Joined: Mar 2005
I'm not exactly sure what you mean or how to do that. I'm a newbie at server stuff.
openmind posted this at 11:14 — 24th March 2005.
He has: 945 posts
Joined: Aug 2001
OK it really depends if you have access to a conmtrol panel for the domain. If you can't do the above through the panel, simply ask your host to do it for you...
It won't cost them anything and should take less than 5 minutes...
Citizen posted this at 06:10 — 25th March 2005.
They have: 8 posts
Joined: Mar 2005
I do have access to the control panel.
openmind posted this at 11:31 — 25th March 2005.
He has: 945 posts
Joined: Aug 2001
OK so whats the control paenl? cPanel, Ensim, HELM?
Citizen posted this at 19:30 — 25th March 2005.
They have: 8 posts
Joined: Mar 2005
cPanel
openmind posted this at 21:38 — 25th March 2005.
He has: 945 posts
Joined: Aug 2001
http://www.cpanel.net/docs/cp/index.html
Have a look at the docs above and if your host has enabled he feature, you will be able to assign a dedicxated IP and change the dns records.
Citizen posted this at 05:30 — 28th March 2005.
They have: 8 posts
Joined: Mar 2005
I cant seem to find the guide you're talking about.
openmind posted this at 13:20 — 28th March 2005.
He has: 945 posts
Joined: Aug 2001
I would suggest speaking to your host to be honest...
JamesC posted this at 15:18 — 9th April 2005.
They have: 5 posts
Joined: Apr 2005
You could try a rewrite rule in .htaccess
maybe something like this.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^*.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.*.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
of course change domain.com to your domain.
Good luck.
Now offering cPanel hosting packagesJC-Hosting
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.