mapping hostname.com/username to a page

  • Thread starter Thread starter John Mott
  • Start date Start date
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-asp-net.aspx
 
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-rewri...

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
 
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
 
Thanks! I'm guessing that you have to use either relative paths (./) or
complete (http://) paths for images, stylesheets etc.?

john
 
Back
Top