Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 244,293 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 907 people online right now. Registration is fast and FREE... Join Now!




Faking URL Subfolders as 'Profiles'

 
Reply to this topicStart new topic

Faking URL Subfolders as 'Profiles'

Vextor
13 Jan, 2009 - 10:50 PM
Post #1

D.I.C Regular
Group Icon

Joined: 22 May, 2002
Posts: 303



Thanked: 1 times
Dream Kudos: 25
My Contributions
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
CODE
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' wink2.gif

Thanks,
Brandon

This post has been edited by Vextor: 13 Jan, 2009 - 10:52 PM

User is offlineProfile CardPM
+Quote Post


dklingman
RE: Faking URL Subfolders As 'Profiles'
14 Jan, 2009 - 05:01 AM
Post #2

D.I.C Regular
Group Icon

Joined: 23 Dec, 2008
Posts: 254



Thanked: 31 times
My Contributions
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

User is offlineProfile CardPM
+Quote Post

Christopher Elison
RE: Faking URL Subfolders As 'Profiles'
14 Jan, 2009 - 05:31 AM
Post #3

D.I.C Head
**

Joined: 29 Dec, 2008
Posts: 83



Thanked: 10 times
My Contributions
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.microsoft.com/en-us/library/ms972974.aspx
http://www.simple-talk.com/dotnet/asp.net/...or-asp.net-2.0/
http://weblogs.asp.net/scottgu/archive/200...th-asp-net.aspx

This post has been edited by Christopher Elison: 14 Jan, 2009 - 05:32 AM
User is offlineProfile CardPM
+Quote Post

dklingman
RE: Faking URL Subfolders As 'Profiles'
14 Jan, 2009 - 05:36 AM
Post #4

D.I.C Regular
Group Icon

Joined: 23 Dec, 2008
Posts: 254



Thanked: 31 times
My Contributions
well you learn something new everyday icon_up.gif icon_up.gif
User is offlineProfile CardPM
+Quote Post

Vextor
RE: Faking URL Subfolders As 'Profiles'
14 Jan, 2009 - 10:47 AM
Post #5

D.I.C Regular
Group Icon

Joined: 22 May, 2002
Posts: 303



Thanked: 1 times
Dream Kudos: 25
My Contributions
QUOTE(Christopher Elison @ 14 Jan, 2009 - 05: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.microsoft.com/en-us/library/ms972974.aspx
http://www.simple-talk.com/dotnet/asp.net/...or-asp.net-2.0/
http://weblogs.asp.net/scottgu/archive/200...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. smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 04:11PM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month