Bug in category feed url?

Jan 31, 2009 at 6:12 PM
Edited Jan 31, 2009 at 6:15 PM
Hi, I'm not sure if this is a bug or the result of me changing something way back when. I noticed that my category feeds in my archives page were pointing to dead links. The category feed links are also handled like this in the categorylist control. I just went to check the latest version and that's how they have it. Does the url format below work for anyone? Thanks

** Just noticed that the file extension is also hard-coded

Example of feed url generated

Method in archive.cs
private static HtmlGenericControl CreateRowHeader(Guid id, string name, int count)
        HtmlAnchor feed = new HtmlAnchor();
        feed.HRef = Utils.RelativeWebRoot + "category/feed/" + Utils.RemoveIllegalCharacters(name).ToLower() + ".aspx";

        if (id != Guid.Empty)
            HtmlImage img = new HtmlImage();
            img.Src = Utils.RelativeWebRoot + "pics/rssbutton.gif";
            img.Alt = "RSS";

        HtmlGenericControl h2 = new HtmlGenericControl("h2");
        h2.Attributes["id"] = Utils.RemoveIllegalCharacters(name);

        Control header = new LiteralControl(name + " (" + count + ")");
        return h2;
Jan 31, 2009 at 6:45 PM
In be 24719 (the latest version), the category feed is working for me.  An example feed Url on my local machine is,


Are you still using the HTML extension?  That could be the problem.  If I change my web.config to use the HTML extension instead of ASPX, then I do get a 404 error.  The correct Url in that case should have an HTML extension.


So, it looks like the archive.aspx.cs is incorrectly assuming the extension is ASPX.  That line of code in archive.aspx.cs should instead be:

feed.HRef = Utils.RelativeWebRoot + "category/feed/" + Utils.RemoveIllegalCharacters(name) + BlogSettings.Instance.FileExtension;

(the dot isn't necessary BTW, it's already included in BlogSettings.Instance.FileExtension)
Jan 31, 2009 at 7:01 PM
It was the extension :) Thanks Ben!
Jan 31, 2009 at 7:13 PM
Cool ... glad I remembered you were using that extension :-)  I created an issue in the tracker for this, btw.