This project is read-only.

Errors: Cannot use a leading ..

Topics: Developer Forum, User Forum
Feb 21, 2008 at 2:12 PM
Edited Feb 21, 2008 at 6:55 PM
Full error is:

"System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.HttpException: Cannot use a leading .. to exit above the top directory."


at System.Web.Util.UrlPath.ReduceVirtualPath(String path)

Searching, there seems to be a fair amount of discussion about this error, caused by certain (search) agents and url rewriting. I haven't found the "short answer" of how to fix it, yet.

Anybody else getting the error?

Mar 5, 2008 at 5:38 PM
Edited Mar 5, 2008 at 5:38 PM

This is an error on some sites that employ Url Rewriting and it's triggered by Googlebots and Yahoo slurps. It can inhibit crawling/indexing of your site by these spiders.. and your SEO.

The common 3 suggested fixes for this are to create .browser files, override the HtmlTextWriter method in a base page class, or add "cookieless="UseCookies" to the "<forms ..." element in the web.config.

I tried the simplest, adding the cookieless attribute, and it fixed my intalls.

I don't know if this affects MWPSK "out of the box", as I've a few modifications. But where I tested and verified, , is a good place to test yours. (Select Googlebot as the agent) Also, only certain pages failed on mine, so test several pages.

Hope this helps some :-)

Apr 6, 2008 at 6:41 PM
Thanks! It worked for me...