3

I have a domain (www.example.com) with a subdomain (test.example.com)

I also have a domain pointer (www.pointer.com) pointing to www.example.com

What I would like to do is have anybody who types in www.pointer.com in the browser view test.example.com

<rule name="CanonicalHostNameRule1" patternSyntax="Wildcard" stopProcessing="true">
                <match url="*" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="www.pointer.com" />
                    </conditions>
                        <action type="Rewrite" url="test.example.com" />
                    </rule>
        </rules>

but that just sends me to a HTTP Error 404.0 - Not Found page

Is there any way to pull this off?

This is running on IIS (windows) with php

Allen
  • 722
  • 4
  • 13
  • 31

1 Answers1

1

You will need to change the action type to Redirect. A rewrite will only invoke a different resource on the server but will not change the URL in the browser. Other than that your rule looks good to me.

Jeroen
  • 3,443
  • 2
  • 13
  • 15
  • I was using a rewrite because I want the person to see they are still on the pointer.com site. I know a redirect will work, but that's not what I want. Is this not possible? – Allen Nov 03 '16 at 15:32
  • Is test.example.com a different site? If so it is possible but you will need to use Application Request Routing (ARR) module, see a scenario here: http://nicolas.guelpa.me/blog/2015/02/21/rewrite-redirect-iis.html#rewrite-outside-websites – Jeroen Nov 03 '16 at 16:09
  • the "example" domain is is the A record for the server. The domain pointer is another domain I own. If this requires installing an app on the server, I don't think that is possible since Everleap (the hosting server) doesn't like doing that, unfortunately. – Allen Nov 03 '16 at 16:21
  • ARR is not a separate app but an IIS extension just like the rewrite module itself. I'm not familiar with everleap but from this post it seems like they support ARR http://forum.everleap.com/threads/disabling-arrs-instance-affinity-in-windows-azure-web-sites.132/ – Jeroen Nov 03 '16 at 16:29