Subdomain redirection


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.

Subdomain1 was configured to use ~/ so it will work as normal.
Subdomain2 was not configured so it will point to ~/ and it will work as if subdomain2 was originaly created with exactly the same content as 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.)? [NC]
RewriteCond %{HTTP_HOST} ^(.) [NC]
RewriteRule .
/index.php?s=%1 [L]

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

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]


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