Explore Courses Blog Tutorials Interview Questions
0 votes
in Azure by (45.3k points)

I want to direct some of my other domains to my primary domain which is hosted at a Windows Azure website.

(For the sake of those that find working with CNAME's and DNS a little "foggy" (like I did) I'm going to layout the details.)

I have the domain correctly resolving.

I now want to point to

At my registrar, I have created a CNAME to point to 
and then successfully configured it in the Azure Website domain manager tool.

Now, when I enter into a browser, I get the proper web page at, however, the address in the browser is still not as desired.

I understand the two most desirable ways to accomplish this are either:

  1. Forward (which costs $ at some registrars)
  2. Do a 301 permanent redirect

If I have all that correct, I have found many suggestions of HOW to do the 301 redirects, however, I can't seem to figure out WHERE to actually put the redirect?

1 Answer

0 votes
by (16.8k points)

You can also do the redirect by placing this code in your web.config file under the configurationnode:


  <location path="oldpage1.php">


      <httpRedirect enabled="true" destination="" httpResponseStatus="Permanent" />



  <location path="oldpage2.php">


      <httpRedirect enabled="true" destination="" httpResponseStatus="Permanent" />




Browse Categories