0

I'm trying to handle domain requests like whois.innovacube.com/anydomain.com like whois.domaintools.com/stackoverflow.com

My global.asax file contains code below and it handles requests like /test :

<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>

<script runat="server">    
    void RegisterRoutes(RouteCollection routes)
    {
        routes.Ignore("{resource}.axd/{*pathInfo}"); // ignore web resources etc

        routes.MapPageRoute("domain", "{domain}", "~/default.aspx");
    }
    void Application_Start(object sender, EventArgs e)
    {
        RegisterRoutes(RouteTable.Routes);
    }
</script>
HasanG
  • 12,734
  • 29
  • 100
  • 154

2 Answers2

1

I've solved problem by creating web.config file and adding lines below:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
HasanG
  • 12,734
  • 29
  • 100
  • 154
0

did you try this

routes.MapPageRoute("domain", "{*domain}", "~/default.aspx");

it should catch all

Kris Ivanov
  • 10,476
  • 1
  • 24
  • 35