问题
I have my project set up with the virtual path "/MyVirtualPath", create the virtual directory in IIS 6 (W2003) and everything works fine.
Then to work better with Google Analytics I change the virtual path "/myvirtualpath" and change all redicecciones and links to lowercase. also applies the class "lowercase route urls in aspnet mvc" and works perfectly.
The problem I had to modify the virtual directory in IIS, delete virtual path "/MyVirtualPath" and I created the new "/myvirtualpath", but in all cases I use tilde "~" or where I make a "RedirecToAction" (which should take "LowercaseRoute"), continues to maintain the virtual path "/MyVirtualPath".
For example, if I see the HTML source code in the browser, see "/MyVirtualPath/Content/Site.css" instead of "/myvirtualpath/Content/Site.css. "
Thanks
回答1:
- Make sure to reset IIS (run iisreset) when you make changes like this. Sometimes there are caching issues.
- Try searching your metabase file directly for "MyVirtualPath" and editing it by hand. This is a dangerous and ugly technique, so take proper precautions before doing so (e.g., make sure the server is configured to automatically backup your metabase and reload it if you mess up). Though changing case is unlikely to break anything.
来源:https://stackoverflow.com/questions/4563043/root-path-with-tilde-does-not-change-upper-case-to-lower-case