View Single Post
Old 10-02-2007, 11:24 AM  
directfiesta
Too lazy to set a custom title
 
directfiesta's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Punta Cana, DR
Posts: 29,918
Setting up a Wildcard or Catch-all Subdomain

The set-up is pretty easy, just a simple modification of the DNS to include a record with the name:

*.domain.ca

Then add the same thing to your ServerAlias line in the Apache configuration. (You probably won?t have permission to perform the two previous steps if you?re on shared hosting, so ask your web host to do it for you). Finally, create a mod_rewrite that will read the subdomain as a parameter on another page, e.g.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.domain.ca
RewriteRule ^(.*) http://www.domain.ca/?p=$1 [L,R=301]
__________________
I know that Asspimple is stoopid ... As he says, it is a FACT !

But I can't figure out how he can breathe or type , at the same time ....
directfiesta is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote