Sure - this code isn't one of the unique/important bits of the product, so
why not.
I've been trying to share more code via my blog lately, so I figured I'd
kill two birds with one stone and post the syntax-highlighted code there for
everyone:
http://www.opinionatedgeek.com/Blog/blogentry=000205/blog.aspx
Good luck,
Geoff
> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Julian Voelcker
> Sent: 20 March 2006 11:30
> To: [email protected]
> Subject: Re: [ADVANCED-DOTNET] URL Rewriting using VirtualPathProvider
>
> Hi Geoff,
>
> Thanks for getting back to me - it's nice to know there are others out
> there
> using this!
>
> > There
> > were/are problems with URL rewriting and permissions in .NET 1.1, where
> you
> > couldn't apply access permissions in your web.config to rewritten URLs
> if
> > the directory didn't exist - maybe that's what's causing the mixup? (I
> > don't know if that limitation still applies in .NET 2, by the way - I
> > haven't tried it.)
>
> OK, that's something I will have to deal with at some point, but just need
> to
> get up and running first.
>
> > What I have tried, though, is using the VirtualPathProvider, VirtualFile
> and
> > VirtualDirectory classes. In my current situation, I have a hidden
> folder
> > (say _projects) that contains the ASPXs for all projects, and I have the
> > VirtualPathProvider code map that so that URLs like
> > /projects/<project-name>/Blah.aspx are really using the ASPX at
> > _projects/Blah.aspx. There's no dependency on the file existing (it
> happens
> > to exist in my case, but it needn't) - all that matters is that you can
> > return a Stream to the ASPX source.
>
> OK, that is partly what I am trying to do. I have all the images in
> hidden
> directories but will want to be pulling Master files out of a database.
>
> I don't suppose you would be willing to share the code you have used for
> your
> above scenario - every bit helps me build up a picture of what is involved
> ;-)
>
> > For point 2, this should certainly be possible, but you'll need to map
> all
> > the file extensions you're interested in to the ASP.NET handler.
>
> Yes, under IIS6 I have cheated by using a blanket wildcard mapping,
> althought I
> might change that back to being more specific.
>
> --
> Cheers,
>
> Julian Voelcker
> Cirencester, United Kingdom
>
> ===================================
> This list is hosted by DevelopMentorR http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com