Error clicking on a Category, Author, or Tag

Topics: Controls
Jan 26, 2011 at 6:11 PM

Everything works great, including the Admin controls. A little background on how I installed the blog engine on my site: I copied the folders into the main folder of the site I already had setup - it is not in a sub-directory of my site. I changed the name of the "default.aspx" page to "news.aspx" so it wasn't my default page but instead a page I was replacing with the blog.

I have one minor problem: When I click on a Category or the Author for a Post it gives me a "Resource not found" error due to the fact the link given doesn't actually exist.

The link for a category on my site is being setup as: "/category/Category-Name.aspx"
The link for the author on my site is being setup as: "/author/Author-Name.aspx"

The folders and aspx pages in those links don't exist in my site's file structure. Are they suppose to be?

Also, when I click on a Tag it sends the site back to the homepage.

Any ideas? Thanks.

- Jon

Jan 27, 2011 at 7:54 AM

Those URLs are internally rewrote to default.aspx.  So they are being rewritten/forwarded to default.aspx, instead of news.aspx.  The BE default.aspx page (your news.aspx) is what handles displaying posts by category, posts by author and posts by tag.  Looking at the code now, default.aspx is hard-coded in there.

The only option would be to modify the BE code source code, and recompile the BE core project to produce a new BlogEngine.Core.dll file -- which goes in the /bin directory.

In the BE core project is a folder named /Web/HttpModules.  In there is a file named UrlRewrite.cs.  In there, if you search for "default" you'll find about 10 or so references.  Those instances of "default" should be renamed to "news" -- so they are rewrote to news.aspx instead of default.aspx.

Making tags work will probably depend on where the link is coming from ... so there might be 2 or 3 places that need to be updated.  One is in the /widgets/TagCloud folder (widget.ascx.cs).  Another is in the BE core -- /Web/Controls/PostViewBase.cs.  In there is "TagLinks" where the tag URLs are constructed.  For these instances, the links are being constructed like /?tag=tagName ... and should probably be changed to /news.aspx?tag=tagName.

Jan 27, 2011 at 7:52 PM

Your solution was perfect. Thank you very much for the detailed and quick response.