title: Url routing in server 404 error
body: <p>I used to do when the routing server. I have a problem.
  No problem if <strong>http://myweb.com/news/22*.aspx*</strong>
  But
  If <strong>http://myweb.com/news/22</strong> problem: 404 - File or directory not found.</p>
  
  <p>in local no problem , but server error
  Even when .Html or .jsp I use
  What is the problem?</p>
  
  <p>id do this :</p>
  
  <p>global.asax</p>
  
  <pre><code>void Application_Start(object sender, EventArgs e)
  {
      RegisterRoutes(RouteTable.Routes);
  }
  
  public static void RegisterRoutes(RouteCollection routes)
  {
       routes.Add("News", new Route("News/{ID}",new CustomRouteHandler("~/News/News.aspx")));
  }
  </code></pre>
  
  <p>CustomRouteHandler.cs class :</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.Routing;
  using System.Web.Compilation;
  
  public class CustomRouteHandler : IRouteHandler
  {
      public CustomRouteHandler(string virtualPath)
      {
          this.VirtualPath = virtualPath;
      }
  
      public CustomRouteHandler()
      {
      }
  
      public string VirtualPath { get; private set; }
  
      public IHttpHandler GetHttpHandler(RequestContext
            requestContext)
      {
          var page = BuildManager.CreateInstanceFromVirtualPath
               (VirtualPath, typeof(Page)) as IHttpHandler;
          return page;
      }
  }
  </code></pre>
  
  <p>web.config :</p>
  
  <pre><code>    &lt;add assembly="System.Web.Routing, Version=3.5.0.0,Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
  
  &lt;add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,System.Web.Routing, Version=3.5.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35" /&gt;
  
  &lt;add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler,System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" /&gt;
  </code></pre>
  
  <p>link :</p>
  
  <pre><code>&lt;asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/news/22" Text="News"&gt;&lt;/asp:HyperLink&gt;
  </code></pre>