Application_BeginRequest issue

Discussion in 'ASP .Net' started by Joe, Apr 19, 2008.

  1. Joe

    Joe Guest

    I'm trying to use the Application_BeginRequest 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
     
    Joe, Apr 19, 2008
    #1
    1. Advertising

  2. "Joe" <> wrote in message
    news:...
    > I'm trying to use the Application_BeginRequest 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?
    >


    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
    >
    >
    >
     
    ThatsIT.net.au, Apr 19, 2008
    #2
    1. Advertising

  3. 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/prodtechnol/WindowsServer2003/Library/IIS/d
    c6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true

    #A Complete URL Rewriting Solution for ASP.NET 2.0
    http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-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:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.











    --------------------
    >From: "Joe" <>
    >Subject: Application_BeginRequest issue
    >Date: Sat, 19 Apr 2008 10:05:30 -0400
    >
    >I'm trying to use the Application_BeginRequest 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
    >
    >
    >
    >
     
    Steven Cheng [MSFT], Apr 21, 2008
    #3
  4. Joe

    Joe Guest

    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]" <> wrote in message
    news:...
    > 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/prodtechnol/WindowsServer2003/Library/IIS/d
    > c6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true
    >
    > #A Complete URL Rewriting Solution for ASP.NET 2.0
    > http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-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:
    > .
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    > ==================================================
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > --------------------
    >>From: "Joe" <>
    >>Subject: Application_BeginRequest issue
    >>Date: Sat, 19 Apr 2008 10:05:30 -0400
    >>
    >>I'm trying to use the Application_BeginRequest 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
    >>
    >>
    >>
    >>

    >
     
    Joe, Apr 21, 2008
    #4
  5. 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" <> wrote in message
    news:u8gRNc%...
    > 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]" <> wrote in message
    > news:...
    >> 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/prodtechnol/WindowsServer2003/Library/IIS/d
    >> c6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true
    >>
    >> #A Complete URL Rewriting Solution for ASP.NET 2.0
    >> http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-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:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >> --------------------
    >>>From: "Joe" <>
    >>>Subject: Application_BeginRequest issue
    >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
    >>>
    >>>I'm trying to use the Application_BeginRequest 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
    >>>
    >>>
    >>>
    >>>

    >>

    >
    >
    >
     
    George Ter-Saakov, Apr 21, 2008
    #5
  6. Hi, Joe.

    re:
    !> re-writing URLs without extensions

    UrlRewritingNet.UrlRewrite does that :

    http://www.urlrewriting.net/en/Default.aspx

    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 :

    http://vinodunny.spaces.live.com/Blog/cns!F162DB18909CE884!393.entry





    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" <> wrote in message news:u8gRNc%...
    > 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]" <> wrote in message
    > news:...
    >> 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/prodtechnol/WindowsServer2003/Library/IIS/d
    >> c6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true
    >>
    >> #A Complete URL Rewriting Solution for ASP.NET 2.0
    >> http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-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:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >> --------------------
    >>>From: "Joe" <>
    >>>Subject: Application_BeginRequest issue
    >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
    >>>
    >>>I'm trying to use the Application_BeginRequest 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
    >>>
    >>>
    >>>
    >>>

    >>

    >
    >
    >
     
    Juan T. Llibre, Apr 21, 2008
    #6
  7. Joe

    Joe Guest

    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" <> wrote in message
    news:u8gRNc%...
    > 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]" <> wrote in message
    > news:...
    >> 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/prodtechnol/WindowsServer2003/Library/IIS/d
    >> c6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true
    >>
    >> #A Complete URL Rewriting Solution for ASP.NET 2.0
    >> http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-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:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >> --------------------
    >>>From: "Joe" <>
    >>>Subject: Application_BeginRequest issue
    >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
    >>>
    >>>I'm trying to use the Application_BeginRequest 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
    >>>
    >>>
    >>>
    >>>

    >>

    >
    >
    >
     
    Joe, Apr 22, 2008
    #7
  8. 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(include 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:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

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

    --------------------
    >From: "Joe" <>
    >References: <>

    <>
    >Subject: Re: Application_BeginRequest 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]" <> wrote in message
    >news:...
    >> 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/prodtechnol/WindowsServer2003/Library/IIS/d
    >> c6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true
    >>
    >> #A Complete URL Rewriting Solution for ASP.NET 2.0
    >>

    http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-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:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >> --------------------
    >>>From: "Joe" <>
    >>>Subject: Application_BeginRequest issue
    >>>Date: Sat, 19 Apr 2008 10:05:30 -0400
    >>>
    >>>I'm trying to use the Application_BeginRequest 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
    >>>
    >>>
    >>>
    >>>

    >>

    >
    >
    >
    >
     
    Steven Cheng [MSFT], Apr 22, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cynic07
    Replies:
    1
    Views:
    498
    Cynic07
    Jul 31, 2003
  2. Amil
    Replies:
    1
    Views:
    500
    William F. Robertson, Jr.
    Feb 19, 2004
  3. =?Utf-8?B?UGF1bCBEYWx5IChNQ1Ap?=

    Session Start / Application_BeginRequest Issues

    =?Utf-8?B?UGF1bCBEYWx5IChNQ1Ap?=, Jul 4, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    6,926
    Craig Deelsnyder
    Jul 4, 2004
  4. JezB
    Replies:
    3
    Views:
    5,533
  5. Stu
    Replies:
    2
    Views:
    9,450
Loading...

Share This Page