Control over .htaccess: sub->folder rewriting


#1

Greetings all - I have an app on another server/host that requires subdomain->folder rewriting on the fly via htaccess. That is, if someone goes to aaaaa.domain.com it is rewritten to www.domain.com/index.php?sub=aaaaa so that variable can be handled appropriately.

At first try this doesn’t seem to be possble here with DH because of the predefined subdomains (for example, webmail.domain.com). It seems there is a htaccess file somewhere that controls this behavior and I was wondering if I could can access it.

Thanks :slight_smile:


#2

The DH problem is due to DNS wildcarding (lack there of) and the fact that websites are not wildcarded.

In DH’s Apache config, it will have a line that says: ServerName www.domain.com

What you need is this line added: ServerAlias *.domain.com

With a wildcard DNS *.domain.com pointing to the same IP as www.domain.com

However, I do not expect DH will add this for you. Unless you know somebody on the inside and a big wad of cash, I’d have to say you’re SOL, unfortunately.


#3

Good call. I’ll contact DH and see if they’ll add the wildcard…

Many thanks