Virtual subdomain redirect (.htaccess?)

software development


I’m wondering if there’s a way to set up a system such that any attempts to reach the (non-existent) subdomain would instead be redirected to (for example)

I do have one or two actual subdomains up already, which I hope would not be affected by this setup.

I suspect this would involve editing .htaccess, but my familiarity with the vagaries of .htaccess is rather limited.

Any help would be appreciated. Thanks in advance.


First you need a wildcard DNS entry and a virtual host with a wildcard ServerAlias.

In the server configuration, the virutal host with the wildcard ServerAlias directive would have to appear after the virutal hosts for the two subdomains.

It’s an advanced setup that DreamHost doesn’t offer. They would have to set it up manually and I doubt they would do so for inexperienced customers or those that can’t demonstrate a real need for this functionality.

Edit: See this article in the Wiki -

:cool: -//-



Thanks for the information. I’ll have to try to find some other way around the issue.