4 Replies - 1662 Views - Last Post: 14 January 2009 - 11:47 AM Rate Topic: -----

#1 Vextor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 313
  • Joined: 22-May 02

Faking URL Subfolders as 'Profiles'

Posted 13 January 2009 - 11:50 PM

Here goes...

I basically asked this question in 'Web Development', took some time to look into the issue and what I thought would be a solution but, alas, i'm still not sure how to implement this yet. Basically i'm developing an application as a moonlighting project and I need a functionality that can be found at some sites. In any case, the site is going to have unique 'sub pages' that are actually just modified master pages with dynamic data but I need the ability to give the users a path directly to their... for lack of a better term 'profile' (This fits the myspace example anyhow.)

So basically what I need is to get a sub folder name out of the URL and use that name to query against the database for the specific page the user has requested.

So for example typing
www.myspace.com/winksofthebtype
into your browser will take you to my myspace profile. The 'winksofthebtype' is a unique key, specific to my profile and none others. How can either implement or 'fake' this functionality with ASP? I pondered using URL parsing, but IIS will try to serve up that subfolder before the application can even get to it. Any suggestions would be great.

And no, i'm not doing another 'Myspace' ;)

Thanks,
Brandon

This post has been edited by Vextor: 13 January 2009 - 11:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Faking URL Subfolders as 'Profiles'

#2 dklingman  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 33
  • View blog
  • Posts: 263
  • Joined: 23-December 08

Re: Faking URL Subfolders as 'Profiles'

Posted 14 January 2009 - 06:01 AM

i'm not sure if this is how myspace does it but a work around or possible solution would be to create the subfolder through code and it may be a matter of saving a file to the profile folder that your site would read from when navigating to the url.

i'm thinking this is how it's done. for example i go to your profile using that url, but once i'm there if you roll over any link you'll notice that it points to something completely different. again i'm only guessing here
Was This Post Helpful? 0
  • +
  • -

#3 Christopher Elison  Icon User is offline

  • D.I.C Head

Reputation: 39
  • View blog
  • Posts: 230
  • Joined: 29-December 08

Re: Faking URL Subfolders as 'Profiles'

Posted 14 January 2009 - 06:31 AM

Surely you could just use a IIS equivalent of mod_rewrite which allows you to achieve this, for example, you could be visiting www.yoursite.com/JoeBloggs when in actual fact, you're really viewing www.yoursite.com/profile.aspx?user=JoeBloggs it makes URLs look a lot nicer and user friendly.

Check out:
http://msdn.microsof...y/ms972974.aspx
http://www.simple-ta...or-asp.net-2.0/
http://weblogs.asp.n...th-asp-net.aspx

This post has been edited by Christopher Elison: 14 January 2009 - 06:32 AM

Was This Post Helpful? 1
  • +
  • -

#4 dklingman  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 33
  • View blog
  • Posts: 263
  • Joined: 23-December 08

Re: Faking URL Subfolders as 'Profiles'

Posted 14 January 2009 - 06:36 AM

well you learn something new everyday :^: :^:
Was This Post Helpful? 1
  • +
  • -

#5 Vextor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 313
  • Joined: 22-May 02

Re: Faking URL Subfolders as 'Profiles'

Posted 14 January 2009 - 11:47 AM

View PostChristopher Elison, on 14 Jan, 2009 - 05:31 AM, said:

Surely you could just use a IIS equivalent of mod_rewrite which allows you to achieve this, for example, you could be visiting www.yoursite.com/JoeBloggs when in actual fact, you're really viewing www.yoursite.com/profile.aspx?user=JoeBloggs it makes URLs look a lot nicer and user friendly.

Check out:
http://msdn.microsof...y/ms972974.aspx
http://www.simple-ta...or-asp.net-2.0/
http://weblogs.asp.n...th-asp-net.aspx


Yeah, adding a sub folder to the application for each user might be OK for awhile but once the user load gets pretty high it'll get slow and cumbersome - not to mention large.

Chris, your suggestion is likely the best. Unfortunately anything worth a damn that's equivalent to Apache's mod_rewrite is a pay product (that's what I get for hosting on a windows box, eh?) but ISAPI rewrite has a freeware version that works for a single application. Since this will be the only application hosted for now, that will work. I can invest in a paid version later.

Thanks for the direction guys - just what I needed. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1