Application_BeginRequest issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe

    Application_BeginRequest issue

    I'm trying to use the Application_Beg inRequest to re-write the path but it
    doesn't work on the published site when a non-existing URL is called. This
    does work fine in my dev environment.

    For example:
    If I call www.mysite.com/UserName. I want to rewrite the UserName part. This
    works fine in my dev environment but when I publish the site
    Application_Beg inRequest does not get called for this URL. It does however
    get called for any of the existing URLs.

    Is there a setting that needs to be changed in IIS maybe to make this work?

    Thanks,
    Joe



  • ThatsIT.net.au

    #2
    Re: Application_Beg inRequest issue


    "Joe" <jbassking@noem ail.noemailwrot e in message
    news:eGLLMbioIH A.2208@TK2MSFTN GP04.phx.gbl...
    I'm trying to use the Application_Beg inRequest to re-write the path but it
    doesn't work on the published site when a non-existing URL is called. This
    does work fine in my dev environment.
    >
    For example:
    If I call www.mysite.com/UserName. I want to rewrite the UserName part.
    This works fine in my dev environment but when I publish the site
    Application_Beg inRequest does not get called for this URL. It does however
    get called for any of the existing URLs.
    >
    Is there a setting that needs to be changed in IIS maybe to make this
    work?
    >
    not sure

    but you can redirect the 404 error page to one of your own, then you can
    redirect from there to wherever you want


    Thanks,
    Joe
    >
    >
    >

    Comment

    • Steven Cheng [MSFT]

      #3
      RE: Application_Beg inRequest issue

      Hi Joe,

      As you mentioned that the rewriting for that nonexisting path used to work
      on development machine, are you using the Visual Studio test server on dev
      machine? If so , this is the expected behavior because Visual Studio test
      server always intercept all requests to process by ASP.NET runtime.
      However, in IIS hosting scenario, by default, it only forward those
      requests with the registerred extensions(such as .aspx , .ascx , .asmx ...)
      to ASP.NET runtime.

      For the following kind of path:

      Http:// www.mysite.com/UserName

      it will not be forwarded to ASP.NET runtime and be processed by IIS
      directlly. I think you can consider the following means to resolve the
      problem:


      1. You can consider set the default document for the certain IIS site or
      virtual directory so that those directory path url request will be forward
      to the default document page(you configured) and you'll be able to process
      the request in ASP.NET runtime:

      #Setting Up Default Documents (IIS 6.0)
      Gain technical skills through documentation and training, earn certifications and connect with the community

      c6eb1b4-9028-4308-9935-52b64edfad36.ms px?mfr=true

      #A Complete URL Rewriting Solution for ASP.NET 2.0
      Ever wondered whether it's possible to create neater URLS, free of bulky Query String parameters? Gaidar Magdanurov shows you how with a step-by-step guide to his rewriting solution for ASP.NET 2.0.

      for-asp.net-2.0/


      2. As other member suggested, you can also configure a custom 404 error
      page(use your own ASPX page) in IIS:

      #Creating a Custom 404 Error Page
      eSports News, Results, upcoming Matches & live Matches. Learn tricks and guides in the esports space. ✅ We cover CS:GO, Dota 2, LOL, Overwatch & PUBG. 


      eSports News, Results, upcoming Matches & live Matches. Learn tricks and guides in the esports space. ✅ We cover CS:GO, Dota 2, LOL, Overwatch & PUBG. 


      thus, you can get handle of those 404 error for non-existing url request in
      IIS.

      Sincerely,

      Steven Cheng

      Microsoft MSDN Online Support Lead


      Delighting our customers is our #1 priority. We welcome your comments and
      suggestions about how we can improve the support we provide to you. Please
      feel free to let my manager know what you think of the level of service
      provided. You can send feedback directly to my manager at:
      msdnmg@microsof t.com.

      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      Gain technical skills through documentation and training, earn certifications and connect with the community

      ications.
      =============== =============== =============== =====
      This posting is provided "AS IS" with no warranties, and confers no rights.











      --------------------
      >From: "Joe" <jbassking@noem ail.noemail>
      >Subject: Application_Beg inRequest issue
      >Date: Sat, 19 Apr 2008 10:05:30 -0400
      >
      >I'm trying to use the Application_Beg inRequest to re-write the path but it
      >doesn't work on the published site when a non-existing URL is called. This
      >does work fine in my dev environment.
      >
      >For example:
      >If I call www.mysite.com/UserName. I want to rewrite the UserName part.
      This
      >works fine in my dev environment but when I publish the site
      >Application_Be ginRequest does not get called for this URL. It does however
      >get called for any of the existing URLs.
      >
      >Is there a setting that needs to be changed in IIS maybe to make this work?
      >
      >Thanks,
      >Joe
      >
      >
      >
      >

      Comment

      • Joe

        #4
        Re: Application_Beg inRequest issue

        Hi Steven,

        The "Complete URL Rewriting Solution for ASP.NET 2.0" doesn't seem to cover
        re-writing URLs without extensions.

        If I just reconfigure IIS I guess it bypasses all the rules in IIS such as
        the default document and just passes it on. In this case my default page
        doesn't come up.

        I'm running IIS 6.

        Any other suggestions other then handeling the 404 page?

        -Joe

        "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
        news:bFUaKA2oIH A.1036@TK2MSFTN GHUB02.phx.gbl. ..
        Hi Joe,
        >
        As you mentioned that the rewriting for that nonexisting path used to work
        on development machine, are you using the Visual Studio test server on dev
        machine? If so , this is the expected behavior because Visual Studio test
        server always intercept all requests to process by ASP.NET runtime.
        However, in IIS hosting scenario, by default, it only forward those
        requests with the registerred extensions(such as .aspx , .ascx , .asmx
        ...)
        to ASP.NET runtime.
        >
        For the following kind of path:
        >
        Http:// www.mysite.com/UserName
        >
        it will not be forwarded to ASP.NET runtime and be processed by IIS
        directlly. I think you can consider the following means to resolve the
        problem:
        >
        >
        1. You can consider set the default document for the certain IIS site or
        virtual directory so that those directory path url request will be forward
        to the default document page(you configured) and you'll be able to process
        the request in ASP.NET runtime:
        >
        #Setting Up Default Documents (IIS 6.0)
        Gain technical skills through documentation and training, earn certifications and connect with the community

        c6eb1b4-9028-4308-9935-52b64edfad36.ms px?mfr=true
        >
        #A Complete URL Rewriting Solution for ASP.NET 2.0
        Ever wondered whether it's possible to create neater URLS, free of bulky Query String parameters? Gaidar Magdanurov shows you how with a step-by-step guide to his rewriting solution for ASP.NET 2.0.

        for-asp.net-2.0/
        >
        >
        2. As other member suggested, you can also configure a custom 404 error
        page(use your own ASPX page) in IIS:
        >
        #Creating a Custom 404 Error Page
        eSports News, Results, upcoming Matches & live Matches. Learn tricks and guides in the esports space. ✅ We cover CS:GO, Dota 2, LOL, Overwatch & PUBG. 

        >
        eSports News, Results, upcoming Matches & live Matches. Learn tricks and guides in the esports space. ✅ We cover CS:GO, Dota 2, LOL, Overwatch & PUBG. 

        >
        thus, you can get handle of those 404 error for non-existing url request
        in
        IIS.
        >
        Sincerely,
        >
        Steven Cheng
        >
        Microsoft MSDN Online Support Lead
        >
        >
        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we can improve the support we provide to you. Please
        feel free to let my manager know what you think of the level of service
        provided. You can send feedback directly to my manager at:
        msdnmg@microsof t.com.
        >
        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        Gain technical skills through documentation and training, earn certifications and connect with the community

        ications.
        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no
        rights.
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        --------------------
        >>From: "Joe" <jbassking@noem ail.noemail>
        >>Subject: Application_Beg inRequest issue
        >>Date: Sat, 19 Apr 2008 10:05:30 -0400
        >>
        >>I'm trying to use the Application_Beg inRequest to re-write the path but it
        >>doesn't work on the published site when a non-existing URL is called. This
        >>does work fine in my dev environment.
        >>
        >>For example:
        >>If I call www.mysite.com/UserName. I want to rewrite the UserName part.
        This
        >>works fine in my dev environment but when I publish the site
        >>Application_B eginRequest does not get called for this URL. It does however
        >>get called for any of the existing URLs.
        >>
        >>Is there a setting that needs to be changed in IIS maybe to make this
        >>work?
        >>
        >>Thanks,
        >>Joe
        >>
        >>
        >>
        >>
        >


        Comment

        • George Ter-Saakov

          #5
          Re: Application_Beg inRequest issue

          With IIS 6 you do not have much choice.
          The only good solution is to modify IIS settings so it would serve custom
          aspx page (for example 404.aspx). in case of 404 error.

          But then ASP.NET will kick in and you can rewrite URL to anything you
          need....
          Just be careful cause your 404.aspx page will be hit even in case some
          picture is missing.


          George.



          "Joe" <jbassking@noem ail.noemailwrot e in message
          news:u8gRNc%23o IHA.4308@TK2MSF TNGP06.phx.gbl. ..
          Hi Steven,
          >
          The "Complete URL Rewriting Solution for ASP.NET 2.0" doesn't seem to
          cover
          re-writing URLs without extensions.
          >
          If I just reconfigure IIS I guess it bypasses all the rules in IIS such as
          the default document and just passes it on. In this case my default page
          doesn't come up.
          >
          I'm running IIS 6.
          >
          Any other suggestions other then handeling the 404 page?
          >
          -Joe
          >
          "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
          news:bFUaKA2oIH A.1036@TK2MSFTN GHUB02.phx.gbl. ..
          >Hi Joe,
          >>
          >As you mentioned that the rewriting for that nonexisting path used to
          >work
          >on development machine, are you using the Visual Studio test server on
          >dev
          >machine? If so , this is the expected behavior because Visual Studio test
          >server always intercept all requests to process by ASP.NET runtime.
          >However, in IIS hosting scenario, by default, it only forward those
          >requests with the registerred extensions(such as .aspx , .ascx , .asmx
          >...)
          >to ASP.NET runtime.
          >>
          >For the following kind of path:
          >>
          >Http:// www.mysite.com/UserName
          >>
          >it will not be forwarded to ASP.NET runtime and be processed by IIS
          >directlly. I think you can consider the following means to resolve the
          >problem:
          >>
          >>
          >1. You can consider set the default document for the certain IIS site or
          >virtual directory so that those directory path url request will be
          >forward
          >to the default document page(you configured) and you'll be able to
          >process
          >the request in ASP.NET runtime:
          >>
          >#Setting Up Default Documents (IIS 6.0)
          >http://www.microsoft.com/technet/pro.../Library/IIS/d
          >c6eb1b4-9028-4308-9935-52b64edfad36.ms px?mfr=true
          >>
          >#A Complete URL Rewriting Solution for ASP.NET 2.0
          >http://www.simple-talk.com/dotnet/as...ting-solution-
          >for-asp.net-2.0/
          >>
          >>
          >2. As other member suggested, you can also configure a custom 404 error
          >page(use your own ASPX page) in IIS:
          >>
          >#Creating a Custom 404 Error Page
          >http://www.4guysfromrolla.com/webtech/061499-1.shtml
          >>
          >http://www.4guysfromrolla.com/webtech/123000-1.shtml
          >>
          >thus, you can get handle of those 404 error for non-existing url request
          >in
          >IIS.
          >>
          >Sincerely,
          >>
          >Steven Cheng
          >>
          >Microsoft MSDN Online Support Lead
          >>
          >>
          >Delighting our customers is our #1 priority. We welcome your comments and
          >suggestions about how we can improve the support we provide to you.
          >Please
          >feel free to let my manager know what you think of the level of service
          >provided. You can send feedback directly to my manager at:
          >msdnmg@microsof t.com.
          >>
          >============== =============== =============== ======
          >Get notification to my posts through email? Please refer to
          >http://msdn.microsoft.com/subscripti...ult.aspx#notif
          >ications.
          >============== =============== =============== ======
          >This posting is provided "AS IS" with no warranties, and confers no
          >rights.
          >>
          >>
          >>
          >>
          >>
          >>
          >>
          >>
          >>
          >>
          >>
          >--------------------
          >>>From: "Joe" <jbassking@noem ail.noemail>
          >>>Subject: Application_Beg inRequest issue
          >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
          >>>
          >>>I'm trying to use the Application_Beg inRequest to re-write the path but
          >>>it
          >>>doesn't work on the published site when a non-existing URL is called.
          >>>This
          >>>does work fine in my dev environment.
          >>>
          >>>For example:
          >>>If I call www.mysite.com/UserName. I want to rewrite the UserName part.
          >This
          >>>works fine in my dev environment but when I publish the site
          >>>Application_ BeginRequest does not get called for this URL. It does
          >>>however
          >>>get called for any of the existing URLs.
          >>>
          >>>Is there a setting that needs to be changed in IIS maybe to make this
          >>>work?
          >>>
          >>>Thanks,
          >>>Joe
          >>>
          >>>
          >>>
          >>>
          >>
          >
          >
          >

          Comment

          • Juan T. Llibre

            #6
            Re: Application_Beg inRequest issue

            Hi, Joe.

            re:
            !re-writing URLs without extensions

            UrlRewritingNet .UrlRewrite does that :



            It's Open Source, so go grab it...

            A taste of sample code, which shows what you
            need to do to do extensionless URL rewriting, is at :







            Juan T. Llibre, asp.net MVP
            asp.net faq : http://asp.net.do/faq/
            foros de asp.net, en español : http://asp.net.do/foros/
            =============== =============== ========
            "Joe" <jbassking@noem ail.noemailwrot e in message news:u8gRNc%23o IHA.4308@TK2MSF TNGP06.phx.gbl. ..
            Hi Steven,
            >
            The "Complete URL Rewriting Solution for ASP.NET 2.0" doesn't seem to cover
            re-writing URLs without extensions.
            >
            If I just reconfigure IIS I guess it bypasses all the rules in IIS such as
            the default document and just passes it on. In this case my default page
            doesn't come up.
            >
            I'm running IIS 6.
            >
            Any other suggestions other then handeling the 404 page?
            >
            -Joe
            >
            "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
            news:bFUaKA2oIH A.1036@TK2MSFTN GHUB02.phx.gbl. ..
            >Hi Joe,
            >>
            >As you mentioned that the rewriting for that nonexisting path used to work
            >on development machine, are you using the Visual Studio test server on dev
            >machine? If so , this is the expected behavior because Visual Studio test
            >server always intercept all requests to process by ASP.NET runtime.
            >However, in IIS hosting scenario, by default, it only forward those
            >requests with the registerred extensions(such as .aspx , .ascx , .asmx
            >...)
            >to ASP.NET runtime.
            >>
            >For the following kind of path:
            >>
            >Http:// www.mysite.com/UserName
            >>
            >it will not be forwarded to ASP.NET runtime and be processed by IIS
            >directlly. I think you can consider the following means to resolve the
            >problem:
            >>
            >>
            >1. You can consider set the default document for the certain IIS site or
            >virtual directory so that those directory path url request will be forward
            >to the default document page(you configured) and you'll be able to process
            >the request in ASP.NET runtime:
            >>
            >#Setting Up Default Documents (IIS 6.0)
            >http://www.microsoft.com/technet/pro.../Library/IIS/d
            >c6eb1b4-9028-4308-9935-52b64edfad36.ms px?mfr=true
            >>
            >#A Complete URL Rewriting Solution for ASP.NET 2.0
            >http://www.simple-talk.com/dotnet/as...ting-solution-
            >for-asp.net-2.0/
            >>
            >>
            >2. As other member suggested, you can also configure a custom 404 error
            >page(use your own ASPX page) in IIS:
            >>
            >#Creating a Custom 404 Error Page
            >http://www.4guysfromrolla.com/webtech/061499-1.shtml
            >>
            >http://www.4guysfromrolla.com/webtech/123000-1.shtml
            >>
            >thus, you can get handle of those 404 error for non-existing url request
            >in
            >IIS.
            >>
            >Sincerely,
            >>
            >Steven Cheng
            >>
            >Microsoft MSDN Online Support Lead
            >>
            >>
            >Delighting our customers is our #1 priority. We welcome your comments and
            >suggestions about how we can improve the support we provide to you. Please
            >feel free to let my manager know what you think of the level of service
            >provided. You can send feedback directly to my manager at:
            >msdnmg@microsof t.com.
            >>
            >============== =============== =============== ======
            >Get notification to my posts through email? Please refer to
            >http://msdn.microsoft.com/subscripti...ult.aspx#notif
            >ications.
            >============== =============== =============== ======
            >This posting is provided "AS IS" with no warranties, and confers no
            >rights.
            >>
            >>
            >>
            >>
            >>
            >>
            >>
            >>
            >>
            >>
            >>
            >--------------------
            >>>From: "Joe" <jbassking@noem ail.noemail>
            >>>Subject: Application_Beg inRequest issue
            >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
            >>>
            >>>I'm trying to use the Application_Beg inRequest to re-write the path but it
            >>>doesn't work on the published site when a non-existing URL is called. This
            >>>does work fine in my dev environment.
            >>>
            >>>For example:
            >>>If I call www.mysite.com/UserName. I want to rewrite the UserName part.
            >This
            >>>works fine in my dev environment but when I publish the site
            >>>Application_ BeginRequest does not get called for this URL. It does however
            >>>get called for any of the existing URLs.
            >>>
            >>>Is there a setting that needs to be changed in IIS maybe to make this
            >>>work?
            >>>
            >>>Thanks,
            >>>Joe
            >>>
            >>>
            >>>
            >>>
            >>
            >
            >
            >

            Comment

            • Joe

              #7
              Re: Application_Beg inRequest issue

              Well I ended up using the code from the Complete URL Rewriting Solution for
              ASP.NET 2.0 article. I just handle the default document myself.

              "Joe" <jbassking@noem ail.noemailwrot e in message
              news:u8gRNc%23o IHA.4308@TK2MSF TNGP06.phx.gbl. ..
              Hi Steven,
              >
              The "Complete URL Rewriting Solution for ASP.NET 2.0" doesn't seem to
              cover
              re-writing URLs without extensions.
              >
              If I just reconfigure IIS I guess it bypasses all the rules in IIS such as
              the default document and just passes it on. In this case my default page
              doesn't come up.
              >
              I'm running IIS 6.
              >
              Any other suggestions other then handeling the 404 page?
              >
              -Joe
              >
              "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
              news:bFUaKA2oIH A.1036@TK2MSFTN GHUB02.phx.gbl. ..
              >Hi Joe,
              >>
              >As you mentioned that the rewriting for that nonexisting path used to
              >work
              >on development machine, are you using the Visual Studio test server on
              >dev
              >machine? If so , this is the expected behavior because Visual Studio test
              >server always intercept all requests to process by ASP.NET runtime.
              >However, in IIS hosting scenario, by default, it only forward those
              >requests with the registerred extensions(such as .aspx , .ascx , .asmx
              >...)
              >to ASP.NET runtime.
              >>
              >For the following kind of path:
              >>
              >Http:// www.mysite.com/UserName
              >>
              >it will not be forwarded to ASP.NET runtime and be processed by IIS
              >directlly. I think you can consider the following means to resolve the
              >problem:
              >>
              >>
              >1. You can consider set the default document for the certain IIS site or
              >virtual directory so that those directory path url request will be
              >forward
              >to the default document page(you configured) and you'll be able to
              >process
              >the request in ASP.NET runtime:
              >>
              >#Setting Up Default Documents (IIS 6.0)
              >http://www.microsoft.com/technet/pro.../Library/IIS/d
              >c6eb1b4-9028-4308-9935-52b64edfad36.ms px?mfr=true
              >>
              >#A Complete URL Rewriting Solution for ASP.NET 2.0
              >http://www.simple-talk.com/dotnet/as...ting-solution-
              >for-asp.net-2.0/
              >>
              >>
              >2. As other member suggested, you can also configure a custom 404 error
              >page(use your own ASPX page) in IIS:
              >>
              >#Creating a Custom 404 Error Page
              >http://www.4guysfromrolla.com/webtech/061499-1.shtml
              >>
              >http://www.4guysfromrolla.com/webtech/123000-1.shtml
              >>
              >thus, you can get handle of those 404 error for non-existing url request
              >in
              >IIS.
              >>
              >Sincerely,
              >>
              >Steven Cheng
              >>
              >Microsoft MSDN Online Support Lead
              >>
              >>
              >Delighting our customers is our #1 priority. We welcome your comments and
              >suggestions about how we can improve the support we provide to you.
              >Please
              >feel free to let my manager know what you think of the level of service
              >provided. You can send feedback directly to my manager at:
              >msdnmg@microsof t.com.
              >>
              >============== =============== =============== ======
              >Get notification to my posts through email? Please refer to
              >http://msdn.microsoft.com/subscripti...ult.aspx#notif
              >ications.
              >============== =============== =============== ======
              >This posting is provided "AS IS" with no warranties, and confers no
              >rights.
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >--------------------
              >>>From: "Joe" <jbassking@noem ail.noemail>
              >>>Subject: Application_Beg inRequest issue
              >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
              >>>
              >>>I'm trying to use the Application_Beg inRequest to re-write the path but
              >>>it
              >>>doesn't work on the published site when a non-existing URL is called.
              >>>This
              >>>does work fine in my dev environment.
              >>>
              >>>For example:
              >>>If I call www.mysite.com/UserName. I want to rewrite the UserName part.
              >This
              >>>works fine in my dev environment but when I publish the site
              >>>Application_ BeginRequest does not get called for this URL. It does
              >>>however
              >>>get called for any of the existing URLs.
              >>>
              >>>Is there a setting that needs to be changed in IIS maybe to make this
              >>>work?
              >>>
              >>>Thanks,
              >>>Joe
              >>>
              >>>
              >>>
              >>>
              >>
              >
              >
              >

              Comment

              • Steven Cheng [MSFT]

                #8
                Re: Application_Beg inRequest issue

                Thanks for your reply Joe,

                Yes, the "Complete URL Rewriting Solution for ASP.NET 2.0" article is a
                complete overview of all the url rewriting part at ASP.NET site while
                another article I mentioend included something about using the default
                document in IIS.

                Also, I'm afraid so far for request path without extension, we have to use
                IIS configuration together (default document or 404 page) so as to
                intercept them in ASP.NET side. This is because ASP.NET runtime is
                completely hosted upon the underlying IIS framework and all requests arrive
                IIS first and IIS side control whether the requests will be further
                forwarded to ASP.NET side.

                As far as I know, for complete Url Rewriting(inclu de all request paths,
                with extension or without), raw IIS ISAPI filter would be capable of this,
                however, developing raw ISAPI filter is much more expensive than an ASP.NET
                component.

                Sincerely,

                Steven Cheng

                Microsoft MSDN Online Support Lead


                Delighting our customers is our #1 priority. We welcome your comments and
                suggestions about how we can improve the support we provide to you. Please
                feel free to let my manager know what you think of the level of service
                provided. You can send feedback directly to my manager at:
                msdnmg@microsof t.com.

                =============== =============== =============== =====
                Get notification to my posts through email? Please refer to
                Gain technical skills through documentation and training, earn certifications and connect with the community

                ications.

                =============== =============== =============== =====
                This posting is provided "AS IS" with no warranties, and confers no rights.

                --------------------
                >From: "Joe" <jbassking@noem ail.noemail>
                >References: <eGLLMbioIHA.22 08@TK2MSFTNGP04 .phx.gbl>
                <bFUaKA2oIHA.10 36@TK2MSFTNGHUB 02.phx.gbl>
                >Subject: Re: Application_Beg inRequest issue
                >Date: Mon, 21 Apr 2008 15:34:26 -0400
                >
                >Hi Steven,
                >
                >The "Complete URL Rewriting Solution for ASP.NET 2.0" doesn't seem to cover
                >re-writing URLs without extensions.
                >
                >If I just reconfigure IIS I guess it bypasses all the rules in IIS such as
                >the default document and just passes it on. In this case my default page
                >doesn't come up.
                >
                >I'm running IIS 6.
                >
                >Any other suggestions other then handeling the 404 page?
                >
                >-Joe
                >
                >"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
                >news:bFUaKA2oI HA.1036@TK2MSFT NGHUB02.phx.gbl ...
                >Hi Joe,
                >>
                >As you mentioned that the rewriting for that nonexisting path used to
                work
                >on development machine, are you using the Visual Studio test server on
                dev
                >machine? If so , this is the expected behavior because Visual Studio test
                >server always intercept all requests to process by ASP.NET runtime.
                >However, in IIS hosting scenario, by default, it only forward those
                >requests with the registerred extensions(such as .aspx , .ascx , .asmx
                >...)
                >to ASP.NET runtime.
                >>
                >For the following kind of path:
                >>
                >Http:// www.mysite.com/UserName
                >>
                >it will not be forwarded to ASP.NET runtime and be processed by IIS
                >directlly. I think you can consider the following means to resolve the
                >problem:
                >>
                >>
                >1. You can consider set the default document for the certain IIS site or
                >virtual directory so that those directory path url request will be
                forward
                >to the default document page(you configured) and you'll be able to
                process
                >the request in ASP.NET runtime:
                >>
                >#Setting Up Default Documents (IIS 6.0)
                >>
                http://www.microsoft.com/technet/pro.../Library/IIS/d
                >c6eb1b4-9028-4308-9935-52b64edfad36.ms px?mfr=true
                >>
                >#A Complete URL Rewriting Solution for ASP.NET 2.0
                >>
                http://www.simple-talk.com/dotnet/as...ting-solution-
                >for-asp.net-2.0/
                >>
                >>
                >2. As other member suggested, you can also configure a custom 404 error
                >page(use your own ASPX page) in IIS:
                >>
                >#Creating a Custom 404 Error Page
                >http://www.4guysfromrolla.com/webtech/061499-1.shtml
                >>
                >http://www.4guysfromrolla.com/webtech/123000-1.shtml
                >>
                >thus, you can get handle of those 404 error for non-existing url request
                >in
                >IIS.
                >>
                >Sincerely,
                >>
                >Steven Cheng
                >>
                >Microsoft MSDN Online Support Lead
                >>
                >>
                >Delighting our customers is our #1 priority. We welcome your comments and
                >suggestions about how we can improve the support we provide to you.
                Please
                >feel free to let my manager know what you think of the level of service
                >provided. You can send feedback directly to my manager at:
                >msdnmg@microsof t.com.
                >>
                >============== =============== =============== ======
                >Get notification to my posts through email? Please refer to
                >>
                http://msdn.microsoft.com/subscripti...ult.aspx#notif
                >ications.
                >============== =============== =============== ======
                >This posting is provided "AS IS" with no warranties, and confers no
                >rights.
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >--------------------
                >>>From: "Joe" <jbassking@noem ail.noemail>
                >>>Subject: Application_Beg inRequest issue
                >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
                >>>
                >>>I'm trying to use the Application_Beg inRequest to re-write the path but
                it
                >>>doesn't work on the published site when a non-existing URL is called.
                This
                >>>does work fine in my dev environment.
                >>>
                >>>For example:
                >>>If I call www.mysite.com/UserName. I want to rewrite the UserName part.
                >This
                >>>works fine in my dev environment but when I publish the site
                >>>Application_ BeginRequest does not get called for this URL. It does
                however
                >>>get called for any of the existing URLs.
                >>>
                >>>Is there a setting that needs to be changed in IIS maybe to make this
                >>>work?
                >>>
                >>>Thanks,
                >>>Joe
                >>>
                >>>
                >>>
                >>>
                >>
                >
                >
                >
                >

                Comment

                Working...