URL rewriting in Blog Engine.NET

by Prashant 5. June 2010 23:47

I was just looking for a way to get short URL’s for my blog, I used some extensions, some URLrewriter.NET but still not able to get this work. So I drop an e-mail to Scott Hanselman and was waiting for his response. If you look at Scott’s blog you will see that he has very simple URL for his blog posts which eventually get his posts higher ranks on search engine indexing. What I have found so far is that if you have a simple URL the search engine will crawl that page during indexing and your page is on the top of the search results or if it is not on the top then it must be at least on the first page. Remember search engine crawlers will avoid crawling pages that do not have a simple URL, like if your page has a query string it won’t be get crawled by the search engine crawler.

The URLRewriter module in BlogEngine didn’t seems to be working for Posts. I want to have simple SEO friendly URLs like http://www.midnightprogrammer.net/post/Windows-7-Logon-Screen-Changer.aspx and not http://www.midnightprogrammer.net/post/2010/05/30/Windows-7-Logon-Screen-Changer.aspx But there is no way to do this until I hook into BlogEngine.Core.dll.

Open the whole solution in Visual Studio and open Post.cs file and navigate to the RelativeLink property in Post.cs file and change with the below code:

public string RelativeLink
{
	get
	{
		string slug = Utils.RemoveIllegalCharacters(Slug) + BlogSettings.Instance.FileExtension;
		if (BlogSettings.Instance.TimeStampPostLinks)
			return Utils.RelativeWebRoot + "post/" + slug;
		return Utils.RelativeWebRoot + "post/" + slug;
	}
}

Recompile your DLL and place in bin directory in your blogengine root folder. Now you will have short URLs which do not have any date stamp. Having short URLs for all your posts doesn’t affect the posts with old URLs that most of the people have bookmarked on their blogs or on social bookmarking sites. Hope this helps.

Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags:

BlogEngine.NET

Akismet Extension For BlogEngine.NET

by Prashant 15. May 2010 05:26

Since I have started using BlogEngine.NET I never thought of using any other open source blog engine. To me BlogEngine is the most extensible blogging platform availableat present. As a popular blogging, engine blog engine users faces a lot of spam comments. I was so totally annoyed and even after moderating comments I have to manually go and delete the comments. After some search I found an extesion from  Joel Thoms (http://joel.net). Simple and easy to use, dont even require moderation.This extension passes the commnets to Akismet spam database which then checks approves or disapprove commnets.

To get it working you need an API Key which you can get for free at http://akismet.com. Once you get an API key extract the files in App_Code/Extensions folder and jump to your Extension section under Settings.

Once you save your settings you are done. NO MORE SPAM. Laughing

Download: AkismetExtension.zip (3.55 kb)

Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

API | BlogEngine.NET

Windows Live Writer and BlogEngine.NET

by Prashant 30. March 2010 23:57

WinLiveWriter When I started blogging last year, I used to blog the old traditional way, using admin panel and then drafting my post and that too with minimal features that can be available for blogging. The I heard about Windows Live Writer and without thinking I switch over to Live Writer. Though my early experience with Live Writer was not good and some of my posts looked weird after I post them to my blog. May be I was not that too familiar with Live Writer at that time and I drop the idea of using Live Writer to blog….but now I am and much aware about the power of Live Writer.

I am writing this post with Live Writer and that too loaded with some excellent plug-ins which allow me to do what I need to.

If you are blogger and still using the same old admin panel to blog with seriously limited features then this tool is meant for you. I am late to use this tool for blogging, but you should not.

Download the offline installer of Windows Live Essentials which includes other Live services.

Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

BlogEngine.NET | Utils

Lightbox extension for BlogEngine.NET

by Prashant 30. January 2010 06:27

While adding images to the post for illustration purposes, most of the time the resolution of the image is quite bigger then the presentable area. So I decided to install the lightbox extension and therefore I searched all over the net found many lightbx extensions for Blog Engine, but they are not like the one I wanted to have for my blog. So after a bit workaround and after studying different extensions I got it working.

Here check this example.

Installation of the extension: Download the extension from the download link below and follow the below steps to get the extension working.

  1. Place the CSS and JS folder in the root of your BlogEngine setup.
  2. Place AddLightBox.cs and LightBox.cs under Extensions folder (App_Code\Extensions).

The main LightBox extension was taken from http://blog.data-worx.de (site down). A small problem was then reported by MrWize for which he provide the solution by writing another extension AddLightBox.cs. If you want to know more then read here.

The files for this extensions are presented as it is as I have found on the net. I have just assembled them from the net and make it worked for my blog.

Download: LightBox.zip (45.30 kb)

Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

BlogEngine.NET | Jquery

Powered by BlogEngine.NET 1.5.0.7
Visit blogadda.com to discover Indian blogs

About

Name of authorMy name is Prashant Khandelwal. I am a .NET programmer and technology enthusiast from New Delhi, India.

       

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2010

Creative Commons License