Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

mapping  hostname.com/username to a page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Mott - 16 Sep 2007 15:41 GMT
hi all,

I'm working on a project that will have user pages (you'll never guess that
its a social networking site ;-)

I'd like to map http://www.thehost.com/johndoe  to
http://www.thehost.com/userpage.aspx?Id=2223

I know I can do this from IIS but it needs to be on the fly and handle an
arbitrary number of users. In the old days I'd use an ISAPI dll but there
must be a better tool now -- whats the right .net tool for this?

thanks,

john
Andreas Kraus - 16 Sep 2007 17:26 GMT
That's gonna be messy with IIS6. In IIS7 it's a piece of cake as for IIS6 i'd
suggest using this URL scheme:

thehost.com/johndoe.aspx - when using .aspx at the end you're able to dig
into it via (e.g.) global.asax in ASP.NET. If you want to use dynamic
folders, you'd have to missuse 404 Pages to make this work with IIS6, it's
not worth the effort.

Excellent post on URL Rewriting:
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-a
sp-net.aspx


Signature

More on ASP.NET and Silverlight on my blog: http://www.andreas-kraus.net/blog

> hi all,
>
[quoted text clipped - 11 lines]
>
> john
densial - 16 Sep 2007 21:49 GMT
On Sep 17, 4:26 am, Andreas Kraus
<AndreasKr...@discussions.microsoft.com> wrote:
> That's gonna be messy with IIS6. In IIS7 it's a piece of cake as for IIS6 i'd
> suggest using this URL scheme:
[quoted text clipped - 24 lines]
>
> > john

put some code into the Application_Error of your global.asax,
something like

Dim httpEx As HttpException = CType(ex, HttpException)
Dim httpCode As Integer = httpEx.GetHttpCode()
If httpCode = 404 Then
   'go look up the URL and do a redirect to the appropriate page
End If
Nick Chan - 17 Sep 2007 04:10 GMT
another way is to add the http 404 handler in web.config, and in the
processing page, u get URL Referrer.
URL Referrer doesn't work in some ways, but in my experience, with
hostname.com/username, it works everytime

> On Sep 17, 4:26 am, Andreas Kraus
>
[quoted text clipped - 38 lines]
>
> - Show quoted text -
John Mott - 17 Sep 2007 15:27 GMT
Thanks! I'm guessing that you have to use either relative paths (./) or
complete (http://) paths for images, stylesheets etc.?

john

> another way is to add the http 404 handler in web.config, and in the
> processing page, u get URL Referrer.
[quoted text clipped - 51 lines]
>>
>> - Show quoted text -

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.