Redirecting subdomains to external websites

Discussion in 'General' started by wikidd, Aug 20, 2010.

  1. wikidd

    wikidd New Member

    Hopefully this is a simple problem. We are attemping to use ISPConfig to combine all our different services into one Control Panel. The last piece is our DNS provider allows us to setup forwards by creating dns entries like:

    webmail.domain.tld -> forwards to -> http://owa.somedomain.com

    From what I have seen we should be able to mimic the same functionality by creating a subdomain under the websites and redirecting it to an external site. So I setup a subdomain and set the redirection to the site but it just keeps showing the same homepage for the main domain. I have tried the different flags and confirmed the changes are being made in the vhost.

    Is there anything else I should look at or try to see why this isn't working?

    Thanks
     
  2. Rapid2214

    Rapid2214 New Member

    Use DNS

    foo.example.com. CNAME bar.example.com.
    bar.example.com. A 192.0.2.23

    When an A record lookup for foo.example.com is done, the resolver will see a CNAME record and restart the checking at bar.example.com and will then return 192.0.2.23.

    http://en.wikipedia.org/wiki/CNAME_record

    Good luck,

    Marty
     
  3. sjau

    sjau Local Meanie Moderator

    or you could do a http redirect from the actual subdomain....
     
  4. Rapid2214

    Rapid2214 New Member


    Thats what he is attempting to do but failing... :)
     
  5. sjau

    sjau Local Meanie Moderator

    make an index.php and add this to it:

    Code:
    <?php
    /* This will give an error. Note the output
     * above, which is before the header() call */
    header('Location: http://www.example.com/');
    ?>
    
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    This should work by creating a subdomain.

    1) Create a dns a-record for webmail.domain.tld pointing to the same IP address the the website where you want to create the subdomain.
    2) Add a subdomain webmail.domain.tld and select as redirect type "No Flag" and enter as redirect path "http://owa.somedomain.com/".
     

Share This Page