This project is read-only.

Homepage url rewriting - adding /

Topics: ASP.NET 2.0
Feb 1, 2011 at 4:35 PM

We're running into a problem with our blog when coming from a marketing email that adds google UTM parameters to the link. If you goto the link it replaces the url with If you then add params to the url... , the blog appears posts.


Feb 3, 2011 at 3:03 PM


Feb 3, 2011 at 11:54 PM

It looks like if you're using BE 2.0, this problem does not exist.  If you're using a prior version, it can be easily fixed.

In default.aspx.cs, in Page_Load, is code that looks like:

else if (Request.QueryString.Count == 0 || !string.IsNullOrEmpty(Request.QueryString["page"]) ......

Remove the "Request.QueryString.Count == 0 || " part, so it looks like:

else if (!string.IsNullOrEmpty(Request.QueryString["page"]) ......

Untested, but that should do it.

Feb 4, 2011 at 12:58 PM

Thanks Ben, unfortunately that didn't fix it.

I'm not sure what version they are using, is there a config file somewhere that will tell me? I'm not sure theres any possibility of upgrading right now.

Feb 4, 2011 at 1:19 PM

Actually I noticed while playing, that removing the querystring.count portion makes the default site w/o params come up blank too. Not good!

Feb 4, 2011 at 1:34 PM

Got it working by changing it to

Request.QueryString.Count >= 0 

Removing the == 0 would evaluate the rest as False and not get into the loop, so something else had to be there that would evaluate True.

Thanks for getting me in the right direction!