hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : newbie subdomain question
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

newbie subdomain question

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 06-20-2006, 01:57 AM
deko deko is offline
Junior Guru Wannabe
 
Join Date: Aug 2004
Posts: 92

newbie subdomain question


If I have 4 different domains, can I pile them up like this:

primary.com
sub-a.primary.com
sub-b.primary.com
sub-c.primary.com

I assume that's not a problem, but how do I route the traffic?

DNS will point sub-a.com (and b and c) to primary.com, but how do I get requests for
Code:
www.sub-a.com
to
Code:
www.sub-a.com.primary.com
Do I use an .htaccess rewrite?

Something like:

RewriteCond %{HTTP_HOST} ^www.sub-a.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^sub-a.com$ [NC]
RewriteRule ^(.*)$ http :// www .sub-a .primary.com/

Is there any other way to do it?

Thanks in advance.

Reply With Quote


Sponsored Links
  #2  
Old 06-20-2006, 04:56 AM
goldenplanet goldenplanet is offline
Web Hosting Guru
 
Join Date: Jul 2002
Location: Kolding, Denmark
Posts: 292
I haven't checked your rewrite syntax, but the idea seems to be OK. Alternatively you could setup the subdomains in your server configuration if this is a dedicated server.

__________________
Best regards,

Anders C. Madsen
Golden Planet Support - http://www.goldenplanet.com

Reply With Quote
  #3  
Old 06-20-2006, 11:37 AM
deko deko is offline
Junior Guru Wannabe
 
Join Date: Aug 2004
Posts: 92
I think an htaccess rewrite should work - just looking for a sanity check.

It's not a dedicated server. The host allows up to 10 subdomains. I don't know of any other way to make use of them unless I use htaccess rewrites.

Reply With Quote
Sponsored Links
  #4  
Old 06-20-2006, 06:21 PM
brianoz brianoz is offline
Web Hosting Master
 
Join Date: Nov 2004
Location: Australia
Posts: 1,440
Are you using cpanel? Or anything similar? Cpanel has a concept of "parked domains" which does all of this for you. It also has a concept of "addon" domains which essentially have their own private webspace kept in a subdirectory of your main site.

Reply With Quote
  #5  
Old 06-20-2006, 07:17 PM
osphere osphere is offline
Sexy Mariachi
 
Join Date: Nov 2004
Location: Mexico City
Posts: 731
as brianoz said, cPanel is very useful with that cases, if you are on shared, then use the htaccess

Reply With Quote
  #6  
Old 06-22-2006, 09:56 AM
brianoz brianoz is offline
Web Hosting Master
 
Join Date: Nov 2004
Location: Australia
Posts: 1,440
Also, if you park the domains, you can use either an http redirect (can be hard to get right) or a test in your index.php for the main site.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Facebook's Recently Acquired Mobile App Platform Parse Launches Web Hosting for Developers Web Hosting News 2013-05-08 10:49:17
Hackers Post 450,000 Yahoo! Voices User Login Credentials Online Web Hosting News 2012-07-12 10:38:07
Rackspace Blog Looks at Easy Outsourcing for App Development Blog 2012-03-05 19:07:48
Web Host Gazzin.com Upgrades Reseller and VPS Plans Web Hosting News 2011-07-29 18:48:35
Your Peers Love HostingCon. Find Out Why & Register for 2011 Blog 2011-06-10 14:10:34


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?