Mobile app version of vmapp.org
Login or Join
Jennifer507

: Client Provided CName record redirecting/forwarding to my domain with masking I am looking for a solution to an issue that I have. In my scenario, I have a CName record provided by a client,

@Jennifer507

Posted in: #Cname #Iis #Masking #Redirects

I am looking for a solution to an issue that I have. In my scenario, I have a CName record provided by a client, example.com. When the user types in example.com, I need to redirect them to answer.com, but still maintain their URL. When I try simple cname redirects, the referring URL is still in the address bar, and IIS does not know how to load my application. What is the best way to accomplish masking in this format?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jennifer507

1 Comments

Sorted by latest first Latest Oldest Best

 

@Steve110

CNAMEs are not really redirects - they're a DNS record type that allows you to easily manage multiple domains/subdomains pointing to the same IP address, without having to change every one them if the IP changes.

So using a CNAME, as far as IIS is concerned, is no different to just a normal A record.

What you need is an HTTP redirect. This IIS reference page explains how to install the required module, and the syntax to use in your ApplicationHost.config file. Alternatively, the URL Rewrite module will give you more flexibility and you might already have it installed anyway.

If you're using a framework for your application, it may already have features built into it for redirection, so if that's the case make sure you check the docs for your framework before doing it manually.

Also, unless this is a temporary redirect, you'll want to set the HTTP response code to 301 to inform browsers and search engine crawlers that this redirect will always be in place.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme