rewriting URLs?

Discussion in 'ASP .Net' started by Smokey Grindle, Jun 21, 2006.

  1. I use to know how to do this in .net 1.1, but not sure in 2.0 (cant even
    remember 1.1 its been 2yrs since I did ASP.net last) but say I have this
    site that is dynamic

    http://localhost/content.aspx?page=23

    how can I make that translate into this

    http://localhost/Content/23

    that virtual path that translates into an actual page... thanks!
    Smokey Grindle, Jun 21, 2006
    #1
    1. Advertising

  2. In 2.0 theres a new handler, with a section in web.config to list your
    re-mappings called urlMappings.

    http://msdn2.microsoft.com/en-us/library/ms228302.aspx

    Regards

    John Timney (MVP)


    "Smokey Grindle" <> wrote in message
    news:...
    >I use to know how to do this in .net 1.1, but not sure in 2.0 (cant even
    >remember 1.1 its been 2yrs since I did ASP.net last) but say I have this
    >site that is dynamic
    >
    > http://localhost/content.aspx?page=23
    >
    > how can I make that translate into this
    >
    > http://localhost/Content/23
    >
    > that virtual path that translates into an actual page... thanks!
    >
    John Timney \(MVP\), Jun 21, 2006
    #2
    1. Advertising

  3. Patrick.O.Ige, Jun 21, 2006
    #3
  4. doesnt help much with dynamic sites though does it? this is pretty much a
    static rewrite it seems...


    "John Timney (MVP)" <> wrote in message
    news:...
    > In 2.0 theres a new handler, with a section in web.config to list your
    > re-mappings called urlMappings.
    >
    > http://msdn2.microsoft.com/en-us/library/ms228302.aspx
    >
    > Regards
    >
    > John Timney (MVP)
    >
    >
    > "Smokey Grindle" <> wrote in message
    > news:...
    >>I use to know how to do this in .net 1.1, but not sure in 2.0 (cant even
    >>remember 1.1 its been 2yrs since I did ASP.net last) but say I have this
    >>site that is dynamic
    >>
    >> http://localhost/content.aspx?page=23
    >>
    >> how can I make that translate into this
    >>
    >> http://localhost/Content/23
    >>
    >> that virtual path that translates into an actual page... thanks!
    >>

    >
    >
    Smokey Grindle, Jun 21, 2006
    #4
  5. Yes, your not the first person to mention that as an issue, and people have
    alrady started providing workarounds.

    Perhaps this is more up your street
    http://www.urlrewriting.net/Config.aspx?Language=en&AspxAutoDetectCookieSupport=1

    or this:
    http://www.willasrari.com/blog/application-beginrequest-code-in-globalasax/00043.aspx

    --
    Regards

    John Timney (MVP)


    "Smokey Grindle" <> wrote in message
    news:%...
    > doesnt help much with dynamic sites though does it? this is pretty much a
    > static rewrite it seems...
    >
    >
    > "John Timney (MVP)" <> wrote in message
    > news:...
    >> In 2.0 theres a new handler, with a section in web.config to list your
    >> re-mappings called urlMappings.
    >>
    >> http://msdn2.microsoft.com/en-us/library/ms228302.aspx
    >>
    >> Regards
    >>
    >> John Timney (MVP)
    >>
    >>
    >> "Smokey Grindle" <> wrote in message
    >> news:...
    >>>I use to know how to do this in .net 1.1, but not sure in 2.0 (cant even
    >>>remember 1.1 its been 2yrs since I did ASP.net last) but say I have this
    >>>site that is dynamic
    >>>
    >>> http://localhost/content.aspx?page=23
    >>>
    >>> how can I make that translate into this
    >>>
    >>> http://localhost/Content/23
    >>>
    >>> that virtual path that translates into an actual page... thanks!
    >>>

    >>
    >>

    >
    >
    John Timney \(MVP\), Jun 21, 2006
    #5
  6. thanks!

    "John Timney (MVP)" <> wrote in message
    news:...
    > Yes, your not the first person to mention that as an issue, and people
    > have alrady started providing workarounds.
    >
    > Perhaps this is more up your street
    > http://www.urlrewriting.net/Config.aspx?Language=en&AspxAutoDetectCookieSupport=1
    >
    > or this:
    > http://www.willasrari.com/blog/application-beginrequest-code-in-globalasax/00043.aspx
    >
    > --
    > Regards
    >
    > John Timney (MVP)
    >
    >
    > "Smokey Grindle" <> wrote in message
    > news:%...
    >> doesnt help much with dynamic sites though does it? this is pretty much a
    >> static rewrite it seems...
    >>
    >>
    >> "John Timney (MVP)" <> wrote in message
    >> news:...
    >>> In 2.0 theres a new handler, with a section in web.config to list your
    >>> re-mappings called urlMappings.
    >>>
    >>> http://msdn2.microsoft.com/en-us/library/ms228302.aspx
    >>>
    >>> Regards
    >>>
    >>> John Timney (MVP)
    >>>
    >>>
    >>> "Smokey Grindle" <> wrote in message
    >>> news:...
    >>>>I use to know how to do this in .net 1.1, but not sure in 2.0 (cant even
    >>>>remember 1.1 its been 2yrs since I did ASP.net last) but say I have this
    >>>>site that is dynamic
    >>>>
    >>>> http://localhost/content.aspx?page=23
    >>>>
    >>>> how can I make that translate into this
    >>>>
    >>>> http://localhost/Content/23
    >>>>
    >>>> that virtual path that translates into an actual page... thanks!
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Smokey Grindle, Jun 21, 2006
    #6
  7. Smokey Grindle

    Alan Silver Guest

    In article <>, "John Timney (MVP)"
    <> writes
    >In 2.0 theres a new handler, with a section in web.config to list your
    >re-mappings called urlMappings.
    >
    >http://msdn2.microsoft.com/en-us/library/ms228302.aspx


    Do you know if this can be used when the URL entered doesn't contain
    ..aspx? I have a client who wants to advertise URLs like...

    http://www.domain.com/software

    and have it map to the real ASP.NET page. Basically, his audience is
    really not techno-savvy and he is bothered by the .aspx endings as they
    are harder to read. I know I could just bung the various bits of content
    in folders, but I have other reasons why I don't want to do that. This
    urlMappings handler looked just the ticket, but only if it can be used
    with an URL like I showed. I have a suspicion that this URL won't get
    passed to the ASP.NET engine, so the mapping will never get done.

    Any comments? TIA

    --
    Alan Silver
    (anything added below this line is nothing to do with me)
    Alan Silver, Jun 27, 2006
    #7
    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. Dan
    Replies:
    0
    Views:
    343
  2. Kaidi
    Replies:
    5
    Views:
    458
    Andrew Thompson
    Jan 4, 2004
  3. IanW
    Replies:
    1
    Views:
    412
  4. Nathan Sokalski

    Converting Relative URLs into Absolute URLs

    Nathan Sokalski, Aug 11, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    732
    Sriram Srivatsan
    Aug 12, 2008
  5. Toni
    Replies:
    7
    Views:
    174
    Agile Consulting
    Feb 9, 2009
Loading...

Share This Page