How do I make a subdomain point to a specific https url?

6,254

Solution 1

If you're using IIS7 or greater than URL Rewrite is the way to go. A simple rule at the server or site level can watch for the original domain and redirect to the new domain. You can enforce https or most anything else you want.

Solution 2

You could use DNS direct https://mail.domain.com requests to https://website.com by placing a CNAME record in the zonefile for domain.com and by configuring the webserver at website.com to accept and handle requests with a HTTP Host header of mail.domain.com (regardless that the server is website.com). This will be faster.

Otherwise you will need a redirect, either in HTTP headers emitted by a webserver at http[s]://mail.domain.com or an HTML redirect in an index.html (or equivalent) at that location & URL. The specifics depend on what webserver software you run at that computer. This is more flexible but involves the client making two HTTP requests instead of one.

Solution 3

Well, another way to do this is by using HTML. You could have HTML redirect them using a meta tag. Here is an example.

<meta http-equiv="Refresh" content="5;url=http://www.superuser.com" />

The value of content (5) is how many seconds it will wait until it redirects. The url value is where you will redirect them to. I hope this helps! Comment if you have any other questions.

Share:
6,254

Related videos on Youtube

alexinslc
Author by

alexinslc

Updated on September 17, 2022

Comments

  • alexinslc
    alexinslc over 1 year

    I need to either use DNS or I guess IIS(redirect) to have the following happen.

    mail.domain.com -> https://website.com

    How can I achieve this?