Hi,
For point 1, you don't need the physical directory on your disk. 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.)
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.
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.
I know what you mean about the documentation, but it's not too difficult to
get it up and running once you start.
Geoff
> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Julian Voelcker
> Sent: 20 March 2006 08:30
> To: [email protected]
> Subject: [ADVANCED-DOTNET] URL Rewriting using VirtualPathProvider
>
> Hi,
>
> I'm currently looking into using the VirtualPathProvider for URL
> rewriting and could do with a bit of guidance.
>
> I have scanned over the articles on Scott Guthrie's site as well as the
> recent article on MSDN and a few posts on the ASP.net forums but still
> have one or two questions that I hope someone here can help with;
>
> 1. A number of posts/articles are saying that in order to use a URL
> like http://www.mydomain.com/mydir/mypage.aspx to pull the mypage.aspx
> code from your datastore you actually have to have the directory mydir
> setup on the server - is this true or is there a way around it?
>
> 2. I want to use the VPP to pull info from several sources - for
> example requests for any images types from the /images/ folder I want
> to pull the files from another folder on disk whereas requests for
> anything from the root or the /styles folder I want to either pull
> directly from a database or build up dynamically. Is this possible.
>
> The VirtualPathProvider seems like a fantastic tool, but trying to find
> enough info on it is proving difficult so any help with the above or
> links to good in depth articles would be appreciated.
>
> --
> 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