Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Posted Tuesday, October 17, 2006 10:08 PM by Mischa Kroon

Hi all, a couple of days ago I came across a posting about a bug in URL Rewriting which will totally remove your site from google.

Here is the scoop:
http://communityserver.org/forums/536640/ShowThread.aspx

The title of the threat is appropriately named:
How to disappear from Google, Yahoo, MSN etc... indexes with CommunityServer 2.0 in less than a week...

That should get your attention.

So whats going on:

there appears to be a bug in: System.Web.UI.Html32TextWriter
aka the downlevel browser implementation of System.Web.UI.HtmlTextWriter

Which crashes when used in conjunction with:
Context.RewritePath(“~/page.aspx?ID=1”, False)
or:
Context.RewritePath(“~/page.aspx?ID=1”)

Solutions for this:
use:
Context.RewritePath(“~/page.aspx?ID=1”, True)

But this has a slightly different behaviour which might bring new pain.

Another option is to make sure that the System.Web.UI.HtmlTextWriter is used when a search engine hits the site.

This can be done with a browsercaps file.
or by adding a .browser file in the App_Browser directory of your website.

More details on the problem and solutions:
http://todotnet.com/archive/0001/01/01/7472.aspx

Browsercaps:
http://www.codeproject.com/aspnet/browsercaps.asp
and
http://browsers.garykeith.com/downloads.asp

This is problem has been reported to Microsoft though there hasn't been any kind of patch issued to my knowledge :(

This problem has been resolved for community server in CS 2.1.

Comments

# re: Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Tuesday, October 17, 2006 11:24 PM by Jan Schreuder

Hmmm. I think our bloggingabout site is running on .Net 2.0. I know our administrator has just become father of a son (). I know he will act on this when he can focus on other things again ;-) I tried finding stuff from my blog using google, and it seems only older posts are found.

# re: Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Tuesday, October 17, 2006 11:25 PM by Jan Schreuder

Hmmm. I think our bloggingabout site is running on .Net 2.1. I know our administrator has just become father of a son (). I know he will act on this when he can focus on other things again ;-) I tried finding stuff from my blog using google, and it seems only older posts are found.

# re: Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Wednesday, October 18, 2006 2:09 AM by Mischa Kroon

I know I'm patient but I just wanted to bring some more attention to the problem and point people to a possible better / nicer solution (browsercaps).

# re: Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Wednesday, October 18, 2006 5:33 AM by Dennis van der Stelt

We're running CS 2.1 so we shouldn't need to worry.

I've searched Google for "Bart" using "site:bloggingabout.net bart" and it found multiple resources. Strangly enough it doesn't find the page itself, just rss feeds and history and stuff. But I don't know how the Google Bot works, so might come up some day soon. But the point is, new posts are also indexed.

# re: Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Thursday, October 19, 2006 11:09 PM by Marc Jacobi

Then why are the view rates down? My first few blog entries made a 100 view-hits easily. These days view-hits of 70 are exceptional, most are in the 20-ties range. Why is that then? Is everybody on holidays? Or are we less visible on the net... I don't know the answer either, but I find it remarkable to see such a drop in view-hits...

# re: Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Monday, June 16, 2008 11:56 AM by Gerald Linhofer

The .browser files must be added to the directory App_Browsers instead of App_Browser

# TickleJokes.com Fresh Funny Jokes Everyday

Saturday, August 23, 2008 8:39 AM by Vihutuo Paira

ASP.NET 2.0 has a major problem with URL rewriting. I used the built in URL rewriting support for a small website of mine. The rules were written in the web.config file like this

 <add

      url="~/Clubs/Computer Club.aspx"

      mappedUrl="~/ShowPage.aspx?PageID=17" />

Even after a year I found out that the pages were not getting indexed by google. In fact it was throwing  "Network unreachable error" . The pages which did not use URL rewriting were nicely getting indexed and has even become PR3 now.

It's a very bad bug in ASP.NET 2.0 . I feel sorry for the scores of people who will use it without knowing it and their sites will remain invisible to google.

# re: Severe URL Rewriting bug in Asp.Net v2 - Do not use CS 2.0 with Asp.Net v2

Tuesday, November 04, 2008 7:44 PM by kral oyun

thanks It's a very bad bug in ASP.NET 2.0 . I feel sorry for the scores of people who will use it without knowing it and their sites will remain invisible to google.

Leave a Comment

(required) 
(required) 
(optional)
(required)