Resolve URL

Discussion in 'ASP .Net' started by RSS, Sep 8, 2005.

  1. RSS

    RSS Guest

    Hello everyone.
    I am looking for a solution to following problem. If any one is able to help
    I want to say thank you very much ahead of time.

    My client has a website. For each user they want to have "separate" url in
    following fashion --> www.site.com/username

    Now, having it in such fashion means to have a "folder" for each user and
    they don't want that. Instead they want to be able to parse the url and do
    things based on username.

    When request comes in and that "folder" not there I get "You not authorized
    to view this page" and so on. Now is there a way to be able to pick up that
    URL and parse it somehow and redirect browser to a different page. They have
    very limited access to the IIS because the host this stuff off site and I
    cant physically change the 404 redirect in the IIS, plus I don't want to
    write an app that will depend on errors to process logic. I hope i explained
    it well. If not, then please write back!!! Ill try to clarify.

    Please help!

    Thank you much,

    RSS
    RSS, Sep 8, 2005
    #1
    1. Advertising

  2. RSS

    Onin Tayson Guest

    Why not pass the username as a parameter? i.e.
    www.site.com/default.aspx?UserName=John

    "RSS" <> wrote in message
    news:...
    > Hello everyone.
    > I am looking for a solution to following problem. If any one is able to
    > help I want to say thank you very much ahead of time.
    >
    > My client has a website. For each user they want to have "separate" url in
    > following fashion --> www.site.com/username
    >
    > Now, having it in such fashion means to have a "folder" for each user and
    > they don't want that. Instead they want to be able to parse the url and do
    > things based on username.
    >
    > When request comes in and that "folder" not there I get "You not
    > authorized to view this page" and so on. Now is there a way to be able to
    > pick up that URL and parse it somehow and redirect browser to a different
    > page. They have very limited access to the IIS because the host this stuff
    > off site and I cant physically change the 404 redirect in the IIS, plus I
    > don't want to write an app that will depend on errors to process logic. I
    > hope i explained it well. If not, then please write back!!! Ill try to
    > clarify.
    >
    > Please help!
    >
    > Thank you much,
    >
    > RSS
    >
    Onin Tayson, Sep 8, 2005
    #2
    1. Advertising

  3. RSS

    RSS Guest

    I hear you. If it only was so easy. The idea here is that each user would
    have their own "space" and they dont have to memorize the long URL.

    Thanks for suggestion.

    "Onin Tayson" <> wrote in message
    news:%...
    > Why not pass the username as a parameter? i.e.
    > www.site.com/default.aspx?UserName=John
    >
    > "RSS" <> wrote in message
    > news:...
    >> Hello everyone.
    >> I am looking for a solution to following problem. If any one is able to
    >> help I want to say thank you very much ahead of time.
    >>
    >> My client has a website. For each user they want to have "separate" url
    >> in following fashion --> www.site.com/username
    >>
    >> Now, having it in such fashion means to have a "folder" for each user and
    >> they don't want that. Instead they want to be able to parse the url and
    >> do things based on username.
    >>
    >> When request comes in and that "folder" not there I get "You not
    >> authorized to view this page" and so on. Now is there a way to be able to
    >> pick up that URL and parse it somehow and redirect browser to a different
    >> page. They have very limited access to the IIS because the host this
    >> stuff off site and I cant physically change the 404 redirect in the IIS,
    >> plus I don't want to write an app that will depend on errors to process
    >> logic. I hope i explained it well. If not, then please write back!!! Ill
    >> try to clarify.
    >>
    >> Please help!
    >>
    >> Thank you much,
    >>
    >> RSS
    >>

    >
    >
    RSS, Sep 8, 2005
    #3
  4. RSS

    Ben Rush Guest

    If it absolutely must be in the format of

    www.server.com/folder

    Then I would suggest looking up IIS ISAPI filters, as this will give you the
    power to intrude on the traffic pipeline of IIS and alter data as it comes
    in, and how (and, also redirect). They can be installed and registered on
    the machine. I have written extensions before, never filters, and you're
    probably in the wrong newsgroup to pursue any more questions about them.
    There are other tricks, however, if you wish to do stuff in asp.net.

    Something I figured out a while ago was that you may have '/' as a piece of
    your querystring. That, in conjunction with HttpModules inserted into the
    ASP.Net pipeline (and the registration of a handler for a new file-extension
    type) can make URLs like the following a reality:

    www.server.com/myapplication/filename.dir/folderA
    www.server.com/myapplication/filename.dir/folderB
    ......
    www.server.com/myapplication/filename.dir/folderN

    Your myapplication is an ASP.Net web application and, as such, the ASP.Net
    pipeline will load HttpModules for you - and you'll simply register an
    HttpModule to respond to the request for the '.dir' extesion (or whatever
    you choose). The forward slash '/' character becomes part of your overall
    querystring (it either shows up in the querystring or you can grab it in its
    entirity in the Request object - the exact answer eludes me) as '/folderN'
    which you can then cause to redirect, respond accordingly, etc. For example
    browse to this address: http://www.microsoft.com/default.aspx/blah/blah, it
    resolves to www.microsoft.com.


    --
    Ben Rush
    http://www.ben-rush.net/blog/
    http://www.littlebigendian.com/



    "RSS" <> wrote in message
    news:...
    > Hello everyone.
    > I am looking for a solution to following problem. If any one is able to
    > help I want to say thank you very much ahead of time.
    >
    > My client has a website. For each user they want to have "separate" url in
    > following fashion --> www.site.com/username
    >
    > Now, having it in such fashion means to have a "folder" for each user and
    > they don't want that. Instead they want to be able to parse the url and do
    > things based on username.
    >
    > When request comes in and that "folder" not there I get "You not
    > authorized to view this page" and so on. Now is there a way to be able to
    > pick up that URL and parse it somehow and redirect browser to a different
    > page. They have very limited access to the IIS because the host this stuff
    > off site and I cant physically change the 404 redirect in the IIS, plus I
    > don't want to write an app that will depend on errors to process logic. I
    > hope i explained it well. If not, then please write back!!! Ill try to
    > clarify.
    >
    > Please help!
    >
    > Thank you much,
    >
    > RSS
    >
    Ben Rush, Sep 8, 2005
    #4
  5. RSS,

    Even with the most standard Get you are in my opinion able to do that using
    www.site.com?Id=username

    Therefore what is the real problem?

    Cor
    Cor Ligthert [MVP], Sep 8, 2005
    #5
  6. RSS

    clintonG Guest

    I've developed several secure 'dealership' -- 'membership' type of sites
    that had the exact same requirements so this is somewhat 'old hat' to me.
    Before I waste my time describing the methodologies I've used which may not
    be pertinent or useful I have to ask how secure the client wants their site
    to be?

    Does the client want users to securely login or simply make it easy for
    dimwits to request and access pages that are in the public domain anyway?

    As an aside, ASP.NET 2.0 (RTM November 7th) supports Profiles, Membership
    and Roles this type of project begs for.


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/











    "RSS" <> wrote in message
    news:...
    > Hello everyone.
    > I am looking for a solution to following problem. If any one is able to
    > help I want to say thank you very much ahead of time.
    >
    > My client has a website. For each user they want to have "separate" url in
    > following fashion --> www.site.com/username
    >
    > Now, having it in such fashion means to have a "folder" for each user and
    > they don't want that. Instead they want to be able to parse the url and do
    > things based on username.
    >
    > When request comes in and that "folder" not there I get "You not
    > authorized to view this page" and so on. Now is there a way to be able to
    > pick up that URL and parse it somehow and redirect browser to a different
    > page. They have very limited access to the IIS because the host this stuff
    > off site and I cant physically change the 404 redirect in the IIS, plus I
    > don't want to write an app that will depend on errors to process logic. I
    > hope i explained it well. If not, then please write back!!! Ill try to
    > clarify.
    >
    > Please help!
    >
    > Thank you much,
    >
    > RSS
    >
    clintonG, Sep 8, 2005
    #6
    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. Jon paugh
    Replies:
    1
    Views:
    686
  2. kpg

    Resolve Server URL in Code

    kpg, Oct 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    485
    =?Utf-8?B?RGVlcGFrIEt1bWFyIFZhc3VkZXZhbg==?=
    Oct 4, 2005
  3. ibiza
    Replies:
    8
    Views:
    34,220
    whizsid
    Jul 3, 2008
  4. Replies:
    1
    Views:
    10,110
  5. wwj
    Replies:
    0
    Views:
    499
Loading...

Share This Page