Redirect subdomain


#1

Hi all,

how can I redirect all urls xxx.mydomain.com to www.mydomain.com but xxx.mydomain.com should be shown in the browser
eg:
test.mydomain.com should show www.mydomain.com but test.mydomain.com still needs to be shown in the browser.

This should be possible for all subdomains (not only test.mydoman.com). Every arbitrairy subdomain should do this.

Is this possible,

thanks
Stijn


#2

Yes! This is called a “mirror”. To do this, on the web panel go to Domains => Manage Domains, and click, “add a new domain/subdomain”. On that screen, scroll down to the section on mirroring. The simply input the domain OR subdomain you would like to be the mirror, and input the domain to mirror.

Note: the mirrored domain MUST be in DH’s DNS

For an example, check out: mirror.ericvernon.com; which mirrors ericvernon.com although the URL remains the same.


#3

The problem with the mirror is that it is specific for 1 domain.
I want all xxxxxx in xxxxx.mydomain.com to point to a certain location and thus not a specific domain.


#4

Would a wildcard CNAME work?

-Scott


#5

Now you’re confusing me Scott.

Anyways as far as I know, for a subdomain to load, it must first be created. Meaning a.aagbasdf.com will result in a 404.

Although you probably could do something with the site’s .htaccess, but I’m not familiar with that.


#6

Drat, the CNAME trick won’t work because my Domain won’t respond to foobar.mydomain.com. Apparently, that’s a limitation of Apache’s virtual hosts.

In other words, if your browser shows foobar.mydomain.com, and it’s not a frame that’s hiding the real site, then foobar.mydomain.com must be a domain that’s been created in one way or another at DreamHost.

[edit] Continuing this thought, I believe that it is possible to configure httpd.conf’s Virtual Host for your specific domain to respond to www.yourdomain.com, yourdomain.com, and *.yourdomain.com, but I don’t know if the panel can implement such a change. I know it can be done manually, though.

-Scott


#7

Yeah, support could enable the wildcard subdomains, mapped to the same web directory, as is typically done for multi-wordpress installations and such.

In most other such cases, your .htaccess maps the subdomain to a subdirectory of the top level web directory. In this case, you wouldn’t do that.

What are [color=#CC0000]50DISK50[/color], [color=#CC0000]3DOM50[/color], and [color=#CC0000]1IP1DOM50[/color]?
They’re Dreamhost coupons!


#8

hi all,

Many thanks for the replies.

Since I’m not the biggest Linux/Apache expert I have some problems understanding whether I can implement this on Dreamhost?

I understand that the panel doesn’t support this but can i somehow change a file somewhere manually?

-Stijn


#9

Well, no. You have to send in a support request to get support to set up the DNS part of it.

You’ll have to tell them why you need this - what you intend to do with the wildcard subdomains.

After that you’ll need to do the .htaccess programming yourself - or not depending on what you want to have happen.

What are [color=#CC0000]50DISK50[/color], [color=#CC0000]3DOM50[/color], and [color=#CC0000]1IP1DOM50[/color]?
They’re Dreamhost coupons!


#10

oké, I made a ticket. I hope they can help me out.

Thanks all for the support