BlogEngine - Extension for canonical tags

Now something different - as we use BlogEngine.io for our blog system we experienced issue that this Blog software does not add canonical tags which are needed for SEO.

Now, extension is not that complicated (btw. we use 3.3.6 version).

Search for file account.master and add there in <head> section:

 <link href="https://YOUR_URL/account/login.aspx" rel="canonical" />

As a second step go to BlogEngine.Core project and search for file BlogBasePage.cs (should be in \Web\Controls folder) and add following code (I put it after protected virtual void AddMetaContentType()):

      /// <summary>
        /// Adds the canonical tag to the header.
        /// </summary>
        protected virtual void AddCanonical()
        {
            string rawUrl = String.Concat(this.GetApplicationUrl(), Request.RawUrl);
            //if (rawUrl.Contains("/post/"))
            //{
                //bool hasQueryStrings = Request.QueryString.Keys.Count > 1;
                //if (hasQueryStrings)
                //{
                    Uri uri = new Uri(rawUrl);
                    rawUrl = uri.GetLeftPart(UriPartial.Path);
                    HtmlLink canonical = new HtmlLink();
                    canonical.Href = rawUrl;
                    canonical.Attributes["rel"] = "canonical";
                    Page.Header.Controls.Add(canonical);
                //}
            //}
        }
        private string GetApplicationUrl()
        {
            string basePath;
            string port = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
            string protocol = HttpContext.Current.Request.ServerVariables["SERVER_PORT_SECURE"];
            string serverName = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
            if (port == null || port == "80")
            {
                port = String.Empty;
            }
            else
            {
                port = String.Concat(":", port);
            }
            if (protocol == null || protocol == "0")
            {
                protocol = "http://";
            }
            else
            {
                protocol = "https://";
            }
            basePath = String.Concat(protocol, serverName, port);
            return basePath;
        }
 
In case that you want to add canonical tag only to post pages uncomment
 
if (rawUrl.Contains("/post/"))
 
and in case that you have QueryStrings you'll need to uncomment
 
bool hasQueryStrings = Request.QueryString.Keys.Count > 1;
and
if (hasQueryStrings)
 
 
Hope that this helps.

New version 4.1.6 just published

What is new:

·     Fixed bug when using multiple passwords to unlock documents in case that separator was not |
·     Minor bug fixing

New version 4.0.5 just published

Hi all,

with this version we made a lot of changes.

  • Extended Scan Documents result table to show document extension, file size in bytes or kbytes or mbytes or gbytes. File size can be controlled over Configuration.
  • Scan Documents result table extended also with information about user template in Word documents (Template Name or Template Path) and in Powerpoint (Document Property.Application Template)
  • Also added DocumentExtension information
  • Enabled that in all result grids column position can be changed (simple drag-n-drop)
  • Over Configuration => Document Properties included option to control what document properties will be shown in Scan documents result table and included in results export
  • Search and replace extended to support changes in attached template in Word documents (only for attached templates) and also document property Application Template in case of Powerpoint documents
  • Changed layout of Search&Replace form
  • Extended processing of ReadOnly documents. To enable this go to Configuration => Processing and set Update ReadOnly files. If document is ReadOnly ReplaceMagic will remove this flag, make changes and set ReadOnly flag back afterwards
  • It is possible now to re-order result grid layout (Scan Documents, Hyperlinks, OLE links, Link Sources, Pivot Tables, Search & Replace). Just drag-n-drop columns
  • Newly adjusted column order will be saved and available next time when ReplaceMagic is opened
  • In case that you want to reset column order to original search for documents: gridFindDocumentsLayout.xml, gridHyperlinksLayout.xml, gridOLELinksLayout.xml, gridPivotTablesLayout.xml, gridLinkSourcesLayout.xml and/or gridSearchReplaceLayout.xml and delete them. Usually they are saved in c:\Users\YOUR_USER\AppData\Local\Webtime Corporation\ReplaceMagic.Total 
  • Important: if you export results and then re-order columns import will not work properly. Please keep this in mind
  • Adjusted export always exportd results with same column order like in selected grid
  • In case of export of result in Scan Documents tab you have following new options:
    • Single export file (all scan information split on different sheets)
    • Single export file (all scan information merged in one sheets
  • Bug fixing when exporting Search&Replace string
  • New design of Search&Replace form to allow longer text fields
  • Extended ReplaceMagic Splash screen to show full application version
  • Improved performances of Powerpoint documents processing
  • Changed header titles in Scan Document results table
  • Fixed bug when opening password protected Project documents (documents were skipped)
  • Enforce memory cleanup added to Configuration => Configuration tab. This will enabled ReplaceMagic to do memory cleanup every 100 documents. Otherwise Windows will decide when to make garbage collection and free used memory.

As  you can see a lot of changes. Download latest version and let us know your feedback.

Old ReplaceMagic vs. new version

As you can notice we did not publish new version of ReplaceMagic for long period of time.

Reason is simple - all our development efforts are on new ReplaceMagic version. Old version will get only bug fixing in case of issues.
Progress on new ReplaceMagic is going good - complete application will be redesigned. ReplaceMagic will not be Microsoft Office dependent. It will be multi-thread enables and totally new is that we will have ReplaceMagic.PDF and ReplaceMagic.OneNote version.

Like names suggest we will support changes in PDF and OneNote documents.

First Beta is already shared with some customers and initial feedback is good :).

All current customers will be notified about new ReplaceMagic when we release it.

Of course, stay tuned to new blog posts as we will talk and share some screenshots from new ReplaceMagic.

Btw. did you watch ReplaceMagic video:



Welcome to BlogEngine.NET

If you see this post it means that BlogEngine.NET is running and the hard part of creating your own blog is done. There is only a few things left to do.

Write Permissions

To be able to log in, write posts and customize blog, you need to enable write permissions on the App_Data and Custom folders. If your blog is hosted at a hosting provider, you can either log into your account’s admin page or call the support.

If you wish to use a database to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.  If you are interested in using Microsoft SQL Server, MySQL, SQL CE, or other databases, please see the BlogEngine docs to get started.

Security

When you`ve got write permissions set, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change password, create new users and set roles and permissions. Passwords are hashed by default so you better configure email in settings for password recovery to work or learn how to do it manually.

Configuration and Profile

Now that you have your blog secured, take a look through the settings and give your new blog a title.  BlogEngine.NET is set up to take full advantage of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.  Be sure to fill in your author profile to take better advantage of this.

Themes and Plugins

One last thing to consider is customizing the look and behavior of your blog. We have themes and plugins available right out of the box. You can install more right from admin panel under Custom.

On the web

You can find news about BlogEngine.NET on the official website. For tutorials, documentation, tips and tricks visit our docs site. The ongoing development of BlogEngine.NET can be followed at Github. You can also subscribe to our Youtube channel.

Good luck and happy writing.

The BlogEngine.NET team