Allen
Allen

Reputation: 722

Rewrite to Subdomain from Domain Pointer

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

Upvotes: 3

Views: 262

Answers (1)

Jeroen
Jeroen

Reputation: 3583

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.

Upvotes: 1

Related Questions