Last post Jun 02, 2011 03:13 AM by Anand Mani Tiwari
Dec 28, 2009 07:50 PM|AmyZ|LINK
I've been using the second method on ScottGu's blog (http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx) to dymanically rewrite my urls by adding the following to my web config:
All was working great (URLs were being rewritten) but has just suddenly stopped working in the last week in visual studio (offline). My online (shared host) website which is exactly the same is still working fine.
Offline, I'm now getting an error message: Failed to map the path /../products.aspx
The URL is rewritting correctly (/products6557.aspx) and the (products.aspx?category=5667) page does exist. It just doesn't seem to map properly.
I've tried deleting all temporary files. Could there have been any updates recently that would have affected it?
Any ideas greatly appreciated as I've spent days on this and I'm very confused!
Dec 29, 2009 03:20 AM|AmyZ|LINK
Just a little bit more information......
I'm also getting the following messages for the web.config:
Could not find schema information for the element 'rewriter'
Could not find schema information for the element 'rewrite'
Could not find schema information for the attribute 'url'
Could not find schema information for the attribute 'to'
The stack trace (which I can't make any sense of) is:
[InvalidOperationException: Failed to map the path '/project/products.aspx'.] System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +8853082 System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42 System.Web.VirtualPath.MapPathInternal() +4 System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +107 System.Web.HttpRequest.MapPath(VirtualPath virtualPath) +37 System.Web.HttpServerUtility.MapPath(String path) +99 Intelligencia.UrlRewriter.Utilities.HttpContextFacade.MapPath(String url) +59 Intelligencia.UrlRewriter.RewriterEngine.VerifyResultExists(RewriteContext context) +278 Intelligencia.UrlRewriter.RewriterEngine.Rewrite() +606 Intelligencia.UrlRewriter.RewriterHttpModule.BeginRequest(Object sender, EventArgs e) +107 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75Any ideas??
Dec 29, 2009 08:06 PM|AmyZ|LINK
Argh, this took me two full days to find what I'd done wrong!
I'd renamed my project with a space in the name. The rest of the website worked fine but the URL rewrite didn't. Whoops! Tricks for new players.
Thanks to everyone that read my (very long) question
May 26, 2011 08:03 PM|vahidvb|LINK
Jun 02, 2011 03:13 AM|Anand Mani Tiwari|LINK
It is really nice that you found the problem as after reviewing the code I saw all is well.
By the way you are welcome to ask any other doubt frequently. Please mark as an answer so it will increase my rating in the forum.