url rewritting with no extension in url

Discussion in 'ASP .Net' started by =?Utf-8?B?cmFwaWRkYXRh?=, Oct 31, 2006.

  1. Is there a way to rewrite urls that have no extensions in the url, i.e. no
    ..aspx or no .html
    like
    http://www.mywebsite.com/username
    to be rewritten as
    http://www.mywebsite.com/pages/username.aspx

    This is currently done in myspace.com where you can type
    http://www.myspace.com/username

    So far I have not found a solution to this problem.

    When I go to IIS Management Console and try to do the
    configuration extension mapping, it does not allow me to enter
    ..* or no extension for the mapping to the asp.net dll

    Any help is greatly appreciated.

    Thanks,
    Leo
    201-923-9595
     
    =?Utf-8?B?cmFwaWRkYXRh?=, Oct 31, 2006
    #1
    1. Advertising

  2. http://www.fawcette.com/vsm/2002_02/magazine/columns/qa/

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com

    *************************************************
    Think outside of the box!
    *************************************************
    "rapiddata" <> wrote in message
    news:...
    > Is there a way to rewrite urls that have no extensions in the url, i.e. no
    > .aspx or no .html
    > like
    > http://www.mywebsite.com/username
    > to be rewritten as
    > http://www.mywebsite.com/pages/username.aspx
    >
    > This is currently done in myspace.com where you can type
    > http://www.myspace.com/username
    >
    > So far I have not found a solution to this problem.
    >
    > When I go to IIS Management Console and try to do the
    > configuration extension mapping, it does not allow me to enter
    > .* or no extension for the mapping to the asp.net dll
    >
    > Any help is greatly appreciated.
    >
    > Thanks,
    > Leo
    > 201-923-9595
    >
     
    Cowboy \(Gregory A. Beamer\), Oct 31, 2006
    #2
    1. Advertising

  3. You can also get insanely clever with VirtualPathProvider. I'm
    currently writing a blog engine with this (got to while away the hours
    somehow) and it means I can do highly hackable URLS like:

    /index
    /index/2006
    /index/2006/oct.rss
    /posts/TitleOfPost
    /posts/TitleOfPost.json
    /posts/TitleOfPost/comments.rss(0,92)
    /tag/SomeTag/
    /tag/SomeTag/MicroSummary.atom

    where the files referenced by those URLs don't exist, the
    VirtualPathProvider can parse the URL and return an appropriate
    VirtualFile.

    In your case I think you could create VirtualPathProvider to do the
    following:

    is the URL in the pages directory?
    no -> Pass it back to the default handler
    yes ->
    does the URL contain .aspx?
    yes -> pass it back to the default handler
    no -> pass url+".aspx" back to the default handler


    There's a fairly relevant link here
    [http://blogs.msdn.com/davidebb/arch...ne-behavior-using-a-virtualpathprovider.aspx]

    Let me know how you get on if you go down the VPP route, 'cos I'm
    curious.

    Cowboy (Gregory A. Beamer) wrote:

    > http://www.fawcette.com/vsm/2002_02/magazine/columns/qa/
    >
    > --
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    > http://gregorybeamer.spaces.live.com
    >
    > *************************************************
    > Think outside of the box!
    > *************************************************
    > "rapiddata" <> wrote in message
    > news:...
    > > Is there a way to rewrite urls that have no extensions in the url, i.e. no
    > > .aspx or no .html
    > > like
    > > http://www.mywebsite.com/username
    > > to be rewritten as
    > > http://www.mywebsite.com/pages/username.aspx
    > >
    > > This is currently done in myspace.com where you can type
    > > http://www.myspace.com/username
    > >
    > > So far I have not found a solution to this problem.
    > >
    > > When I go to IIS Management Console and try to do the
    > > configuration extension mapping, it does not allow me to enter
    > > .* or no extension for the mapping to the asp.net dll
    > >
    > > Any help is greatly appreciated.
    > >
    > > Thanks,
    > > Leo
    > > 201-923-9595
    > >
     
    Flinky Wisty Pomm, Oct 31, 2006
    #3
  4. Gregory -

    Thanks for the advice but I can not read the other pages in the article past
    page 1 because the article is from 2002 and I have a 2006 subscription to
    msdn magazine.

    Can you please provide the code?

    Thanks,
    Leo
    201-923-9595

    "Cowboy (Gregory A. Beamer)" wrote:

    > http://www.fawcette.com/vsm/2002_02/magazine/columns/qa/
    >
    > --
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    > http://gregorybeamer.spaces.live.com
    >
    > *************************************************
    > Think outside of the box!
    > *************************************************
    > "rapiddata" <> wrote in message
    > news:...
    > > Is there a way to rewrite urls that have no extensions in the url, i.e. no
    > > .aspx or no .html
    > > like
    > > http://www.mywebsite.com/username
    > > to be rewritten as
    > > http://www.mywebsite.com/pages/username.aspx
    > >
    > > This is currently done in myspace.com where you can type
    > > http://www.myspace.com/username
    > >
    > > So far I have not found a solution to this problem.
    > >
    > > When I go to IIS Management Console and try to do the
    > > configuration extension mapping, it does not allow me to enter
    > > .* or no extension for the mapping to the asp.net dll
    > >
    > > Any help is greatly appreciated.
    > >
    > > Thanks,
    > > Leo
    > > 201-923-9595
    > >

    >
    >
    >
     
    =?Utf-8?B?cmFwaWRkYXRh?=, Oct 31, 2006
    #4
    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. Christopher Benson-Manica
    Replies:
    0
    Views:
    437
    Christopher Benson-Manica
    May 11, 2004
  2. Anand
    Replies:
    3
    Views:
    915
    Tim Daneliuk
    Nov 8, 2003
  3. =?Utf-8?B?cmFwaWRkYXRh?=

    url rewriting with no extension in url

    =?Utf-8?B?cmFwaWRkYXRh?=, Nov 1, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    424
    Flinky Wisty Pomm
    Nov 2, 2006
  4. WT
    Replies:
    8
    Views:
    308
    Allen Chen [MSFT]
    Dec 8, 2008
  5. Paul

    rewritting the standards

    Paul, Feb 26, 2011, in forum: C++
    Replies:
    0
    Views:
    227
Loading...

Share This Page