Last week I added a new page to my blog site. The article was very popular and lot of people bookmarked it as well. After 3 days I realized that there is typo in the title that I need to fix. So I made the change. After few minutes of making the change I started getting flood of emails about broken link from the people who bookmarked that article. Then I realized that BlogEngine.net generated URLs for posts and pages based on Title field. So if you change the title of the item, your URL changes as well. Well there are following problems I see with this approach.
After thinking through this, I decided to make change in BlogEngine.net to include a new field named MetaTitle for pages and posts.
This new field allows you to enter a title that is different from what is used to create URL of that post or page. And when you want to update title of the item, you just need to update MetaTitle and never have to worry about URL change because you changed title. You can still change Title field, but it will result in a new URL for your page or post.
You can download the updated code from BlogEngine.Net Update 1.5.3. This update requires change in SQL Server tables. The updated script has been appended at the bottom of the page. I will post that update here as well. This update requires addition of new field MetaTitle in be_Pages and be_Posts tables.
/* Script for MetaTitle features */ ALTER TABLE [dbo].[be_Pages] ADD [MetaTitle] [nvarchar](255) NOT NULL DEFAULT (N'') GO UPDATE [be_Pages] SET [MetaTitle] = [Title] GO ALTER TABLE [dbo].[be_Posts] ADD [MetaTitle] [nvarchar](255) NOT NULL DEFAULT (N'') GO UPDATE [be_Posts] SET [MetaTitle] = [Title] GO
Admin pages Add_Entry and Pages have also been updated to include new text box for MetaTitle field. And all the core code has been updated to account for new database field as well. If you have any feature that you would like implemented or modified, please feel free to contact me. I will be glad to work with you on the changes.