Simply put, how can I redirect test.example.com
to example.com
? I would like to make the sub-domain seem "real" to the user(redirection in the background, URL is still test.example.com/index.html
). I have tried modifying my DNS settings on the domain, the IIS configuration, and added my sub-domain to my Azure configuration.
Web.Config
<rule name="Push Subdomain to Push folder">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^test.example.com$" />
</conditions>
<action type="Rewrite" url="http://example.com/test/{R:1}" />
My DNS Configuration:
Sub-Domain: test | URL: example.azurewebsites.net | Record Type: CNAME (alias)
When I do this, I get this error message:
The page cannot be displayed because an internal server error has occurred.
I have fixed the issue by changing the above to