I used the UrlRewriting.Net module for a couple of years without any problems in Windows XP and Windows 2003. I recently upgraded my home computer to Windows 7 and started developing a new website.
The plan was to use the .html extensions and rewrite them in their .aspx copies using the UrlRewriting.Net module. Everything works flawlessly in VWD 2008 , but when I try to run it through IIS7, this is a completely different story.
When I try to access a page through .html rewrite, I can no longer access Page.User; he keeps returning null. If I click on a page using the .aspx extension, the .User page fills correctly. I should also mention that I have a LoginView controller on my main page and it experiences the same symptoms: when accessed via the .html extension, it shows AnonyousTemplate; When using the .aspx extension, it correctly displays the LoggedInTemplate. I assume that they are related to each other.
[Note. I also tried URLs without links and they show the same problem]
The only way I worked was to switch the application pool to Classic, which then requires me to add the ASP.Net ddl handler for the .html extension [otherwise it is processed by StaticFileHandler and appears as a 404 error]. However, I would like my web application to work correctly for people without having to deal with IIS.
So, I have a few questions left:
- Does anyone have any ideas as to why Page.User is always zero for .html => .aspx rewritten pages?
- Why does it work in VWD 2008, but not IIS7?
- What has changed from IIS6 => IIS7 that could cause this?
- Any other thoughts on workarounds?
[Note: I just tried to rewrite .aspx => .aspx and did not find a problem. Not quite what I want, but thought I should mention it.]