Subdomain redirection


#1

Hi,

In my previous hoster I used CPanel and it as a feature that if I don’t have a subdomain set up it will redirect automaticaly to the main domain.

Ex:

http://subdomain1.mydomain.com
Subdomain1 was configured to use ~/mydomain.com/subdomain1 so it will work as normal.

http://subdomain2.mydomain.com
Subdomain2 was not configured so it will point to ~/mydomain.com and it will work as if subdomain2 was originaly created with exactly the same content as mydomain.com or whatever I decide to pull out.

Basicaly this bellow is not working in what concerns subdomain redirection:

ErrorDocument 401 /index.php?e=401
ErrorDocument 403 /index.php?e=403
ErrorDocument 404 /index.php?e=404
ErrorDocument 500 /index.php?e=500
ErrorDocument 503 /index.php?e=503

RewriteEngine On

RewriteCond %{HTTP_HOST}!^(www.)?mydomain.com [NC]
RewriteCond %{HTTP_HOST} ^(.).mydomain.com [NC]
RewriteRule .
/index.php?s=%1 [L]

RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .(jpe?g|gif|png)$ - [F,L]


#2

It sounds like you are referring to a wildcard DNS record. I don’t believe DreamHost supports these on their shared hosting accounts.

Here is a quote from the wiki article on the subject;

[color=#0000CC]“Wildcards… in general, we will not add wildcard DNS records for you on a shared hosting account. This is for a number of reasons. If you have a special request, we’ll consider it, provided you truly understand all of the implications of doing this.”[/color]

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )