views:

233

answers:

2

Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding content: a development team adding code and a business team adding simple web pages. For sanity and organization, we would like for the business team to add their web pages to a sub-folder in the project.

Root <-- development team pages go here

.. Content <-- business team pages go here

But ... we would like for users to be able to navigate to the business team content without having to append "Content" in their URLs.

Root

..Default.aspx <-- Available at www.oursite.com/default.aspx

..Content

...Popcorn.aspx <-- Available at www.oursite.com/popcorn.aspx

Short of making a config entry in an ISAPI rewrite tool for every one of these pages, is there a way we can accomplish this?

Edit: Apologies for the odd layout ... the markdown preview doesn't seem to match reality so I had to make do.

+1  A: 

Since the extensions will be ASPX, ASP.NET will pick up the request... you can write an HttpModule that checks for pages that yield a 404 and then check the subfolder also.

If you know that all pages with a certain format will be coming from that folder, then you can just rewrite the URL in ASP.NET (either in Global.asax or an HttpModule).

Ben Scheirman
+1  A: 

I don't have any way to test this right now, but I think you can use the -f flag on RewriteCond to check if a file exists, in either directory.

RewriteCond %{REQUEST_FILENAME} -!f
RewriteCond Content/%{REQUEST_FILENAME} -f
RewriteRule (.*) Content/(.*)

Something like that might do what you're after, too.

Adam Cuzzort