Category URL re-write problem?

Sep 30, 2009 at 1:59 PM
Edited Sep 30, 2009 at 2:02 PM

I am using BE 1.5 build 28608 and it appears the categories are not working properly.

If i add a category to a post, it correctly shows a link to that category in the postview. 

When I click the link it directs it to /Category/[category name].aspx

UrlRewrite.cs then grabs that and re-writes it to "default.aspx?id=" + cat.Id.ToString() + GetQueryString(context)

That then gets passed to the page_load of default.aspx which seems like it too is looking for /Category/ but that no longer exists in the url so it tries to load a post with the guid of the category, instead of calling DisplayCategories() - since there is no post with that guid, it of course fails.

Where should I be looking to fix this problem? Should urlrewrite be handling /category/ ?  I noticed it doesn't handle /tags/ - that url is simply a ?tag=  (which work for me)




Oct 1, 2009 at 10:35 AM

In default.aspx, it's checking the 'RawUrl' in this line of code below:

if (Request.RawUrl.ToLowerInvariant().Contains("/category/"))

RawUrl contains the URL before the rewriting took place.

If you're debugging, you can check to see what the value of Request.RawUrl is.  It should contain the original URL -- the same URL you see in the address bar.

For reference, Request.Url contains the rewritten URL.