WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-24-2008, 06:14 PM
Barney Barney is offline
WebProWorld New Member
 

Join Date: Aug 2007
Location: Devon, England
Posts: 10
Barney RepRank 0
Default Sub domains at the speed of light?

Hi all

Does anyone know of a way I could get subdomains to resolve instantly. What I'm looking for is some way of having either Apache or PHP (or something else?) resolve a subdomain, so that if someone types in:

1. blimey.domain.com, or
2. yeeha.domain.com, or
3. anythingTheYJOLLYwellLikE.domain.com

the script/page will redirect/resolve to:

1. www.domain.com/index.php?page=blimey
2. www.domain.com/index.php?page=yeeha
3. http://www.domain.com/index.php?page...YJOLLYwellLikE

etc etc.

Thanks a lot!
__________________
Wordpress Comment Nofollow Tool
Reply With Quote
  #2 (permalink)  
Old 04-25-2008, 06:35 AM
speed speed is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 804
speed RepRank 1
Default Re: Sub domains at the speed of light?

First you need to setup a wildcard for the domain in the DNS records e.g.
Code:
*.example.com.      IN  A    1.2.3.4
Second you need to edit httpd.conf to set the ServerName to the same wildcard, e.g.
Code:
<VirtualHost 1.2.3.4>
ServerName www.example.com
ServerAlias *.example.com
....
</VirtualHost>
__________________
TOLRA Micro Systems Limited US & UK Web Hosting with Continuous Data Protection
Web Directory : Web Directory Script
Reply With Quote
  #3 (permalink)  
Old 04-29-2008, 03:23 PM
Barney Barney is offline
WebProWorld New Member
 

Join Date: Aug 2007
Location: Devon, England
Posts: 10
Barney RepRank 0
Default Re: Sub domains at the speed of light?

Thanks for that Speed, I'll give it a go. I'm on Dreamhost shared hosting with this domain, so see how it goes!
__________________
Wordpress Comment Nofollow Tool
Reply With Quote
  #4 (permalink)  
Old 04-29-2008, 06:03 PM
speed speed is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 804
speed RepRank 1
Default Re: Sub domains at the speed of light?

In that case you'll have to ask them to configure it for you.
__________________
TOLRA Micro Systems Limited US & UK Web Hosting with Continuous Data Protection
Web Directory : Web Directory Script
Reply With Quote
  #5 (permalink)  
Old 04-30-2008, 12:34 PM
Barney Barney is offline
WebProWorld New Member
 

Join Date: Aug 2007
Location: Devon, England
Posts: 10
Barney RepRank 0
Default Re: Sub domains at the speed of light?

I've got access to DNS, although not httpd.conf - could I achieve it through .htaccess?
__________________
Wordpress Comment Nofollow Tool
Reply With Quote
  #6 (permalink)  
Old 04-30-2008, 12:48 PM
speed speed is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 804
speed RepRank 1
Default Re: Sub domains at the speed of light?

The .htaccess file is only run if the server recognises the domain being requested.

On cPanel you can login to your account and create a sub-domain called * and it will set up all the DNS and httpd.conf for you.

However as far as I know Dreamhost don't use cPanel hence the reason I said they'll need to do it for you, that is unless their control panel allows a subdomain * to be created.
__________________
TOLRA Micro Systems Limited US & UK Web Hosting with Continuous Data Protection
Web Directory : Web Directory Script
Reply With Quote
  #7 (permalink)  
Old 05-01-2008, 09:11 AM
Barney Barney is offline
WebProWorld New Member
 

Join Date: Aug 2007
Location: Devon, England
Posts: 10
Barney RepRank 0
Default Re: Sub domains at the speed of light?

Pity - I just tried to set up a subdomain within Dreamhost's control panel, and it unfortunately has to be alphanumeric.

Back to the drawing board!
__________________
Wordpress Comment Nofollow Tool
Reply With Quote
  #8 (permalink)  
Old 05-01-2008, 09:57 AM
speed speed is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 804
speed RepRank 1
Default Re: Sub domains at the speed of light?

In that case you have 2 options as I see it a) ask their support to set it up for you or b) put the site with a host that can do it.

Alternatively do you really need wildcard subdomains or could you do it with a folder structure e.g.

example.com/test/
example.com/another/

You could still rewrite it in .htaccess to be example.com/index.php?page=test or whatever.
__________________
TOLRA Micro Systems Limited US & UK Web Hosting with Continuous Data Protection
Web Directory : Web Directory Script
Reply With Quote
  #9 (permalink)  
Old 05-01-2008, 10:06 AM
Barney Barney is offline
WebProWorld New Member
 

Join Date: Aug 2007
Location: Devon, England
Posts: 10
Barney RepRank 0
Default Re: Sub domains at the speed of light?

Well I've got the problem that I don't know what the subdomain is going to be - it can be user generated, and could be anything alphanumeric.

Perhaps I should write to them and see if they can add those lines into httpd.conf - you never know.
__________________
Wordpress Comment Nofollow Tool
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: resolve, sub domain



Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I say speed speed! gimme what I need "billy idol" arpecop Google Discussion Forum 7 04-04-2005 11:12 PM
Luminous Light WPW_Feedbot Graphics & Design Discussion Forum 0 03-22-2005 01:30 AM
Light Arms WPW_Feedbot Graphics & Design Discussion Forum 0 02-19-2005 12:31 AM
Light Up Your Trees WPW_Feedbot Graphics & Design Discussion Forum 0 12-18-2004 01:31 AM
Slowing the speed of light to improve networking WPW_Feedbot IT Discussion Forum 0 12-14-2004 10:41 AM


Search Engine Friendly URLs by vBSEO 3.0.0