redirect subdomain

redirect subdomain

Posted by: tarscher
Posted on: 2008-01-24 02:04:00

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

Re: redirect subdomain

Posted by: Spearfish
Posted on: 2008-01-24 11:25:00

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.

Re: redirect subdomain

Posted by: tarscher
Posted on: 2008-01-24 14:14:00

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.

Re: redirect subdomain

Posted by: sdayman
Posted on: 2008-01-24 14:51:00

Would a wildcard CNAME work?

-Scott

Re: redirect subdomain

Posted by: Spearfish
Posted on: 2008-01-24 15:26:00

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.

Re: redirect subdomain

Posted by: sdayman
Posted on: 2008-01-24 16:39:00

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.

-ScottEdited by sdayman on 01/24/08 04:44 PM (server time).

Re: redirect subdomain

Posted by: Lensman
Posted on: 2008-01-24 21:21:00

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 50DISK50, 3DOM50, and 1IP1DOM50?
They're Dreamhost coupons!

Re: redirect subdomain

Posted by: tarscher
Posted on: 2008-01-25 00:59:00

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

Re: redirect subdomain

Posted by: Lensman
Posted on: 2008-01-25 04:51:00

In reply to:

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


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 50DISK50, 3DOM50, and 1IP1DOM50?
They're Dreamhost coupons!

Re: redirect subdomain

Posted by: tarscher
Posted on: 2008-01-25 07:57:00

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

Thanks all for the support

Tags: subdomainsurls