1

I'm trying to rewrite urls in IIS as subdomains. For example:

I have a webpage: http://websitetrafficcheck.com/site.aspx?url=google.com

and trying access without creating a real subdomain in DNS & IIS, http://google.com.websitetrafficcheck.com

I have found couple of old posts but couldn't work it out.

How to rewrite URL as subdomain in asp.net without actually creating a subdomain on server

How to load virtual sub-domain without adding DNS sub-domain in asp.net using URL rewriting?

I have installed Application Request Routing and enabled proxy and also created a Wildcard DNS Record.

I have tried to debug global.asax and catch to see if there is any requests coming to the asp.net project but it looks like DNS server is not sending to IIS or my rewrite rule doesn't work. Attached the screenshot.

This is the rewrite rule I'm using:

<rule name="Rewrite subdomains">
          <match url="^/?$" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^(.+)\.websitetrafficcheck\.com$" />
          </conditions>
          <action type="Rewrite" url="http://websitetrafficcheck.com?url={C:1}" />
        </rule>

any suggestions are welcome

enter image description here

Edit: Fiddler is displaying "HTTP/1.1 304 Not Modified" when I try to access to http://google.com.websitetrafficcheck.com

Sam Salim
  • 2,145
  • 22
  • 18

0 Answers0