Tag Blot

Posts: 3

Switching CMS's Killed My Inbound Links!

It's no secret that I've switched CMS's so many times that it makes my head and my reader's heads spin.  Take a look at my CMS tag and you'll see my struggles with Wordpress, Expression Engine, Text Pattern, and Blot.

I made a big migration to Jekyll and loved the static type of CMS's ever since. Fast forward to today and I've pretty much settled on Pelican. Why? It's a static CMS and its python powered. It does a great job of streamlining the YAML front end of a post and it's fast to regenerate. The best part? I use rsync to upload new posts to my server and I use the S3 upload to make a backup of my site on Amazon. 

Yet, there's ONE big problem that I've noticed. 100's of my inbound links are all now dead and that messes with my SEO ranking. 

The solution is to create RewriteRules in my .htaccess file and here's some friendly tips on how to do it.

Moving away from Wordpress

The biggest inbound link killer on my Wordpress site was when I switched my permalink slug.  I went from a classic format of  '/year/month/day/my-post' to the simpler one '/my-post.'  Wordpress handles this change if you do it in Wordpress. If you migrate out of Wordpress, well all hell will break loose.

The simple fix is to add following regular expression to your .htaccess file:

RewriteRule /[0-9]+/[0-9]+/[0-9]+/(.*) /$1 [L,R=301] 

What this does is select any /year/month/day/my-post formated URL and returns /my-post!  Awesome, but what about those pesky /wp-content/uploads directory?  There are tons of images I put into my blog posts and now all those inserts don't work. 

The solution for me was to download the /wp-content folder and rename the folder as /_wp-content. I did this because I was using Blot.Im at the time and if I didn't add the _, it would generate 100's of images as blog posts.

RewriteRule /wp-content/uploads/(.*) /_wp-content/uploads/$1 [L,R=301] 

Of course, you don't have to do this. You can move the /wp-content folder to its final destination and have all the links resolve. 

Moving away from Expression Engine 

Oh Expression Engine (EE) how I love and loathe thee. EE is a serious CMS. You can do a lot with it if you spend the time to architect it out. It's powerful but complex. It's too powerful for running a small blog like mine, but I liked it when I used it. 

The thing with EE is that it creates /blog/entry/my-post permalinks. the /blog/ part is the name of the channel and it could be anything you like. It could be /radio/entry/my-post or /store/entry/my-post. For the extended time my blog ran EE, several inbound links went to /blog/entry/my-post.

To solve this problem I created the following rule:

RewriteRule /blog/entry/(.*) /$1 [L,R=301] 

Now EE also had a URL for each category and that created havoc too. Wordpress uses this method too and since I use Pelican now, the categories have become tags, or rather 'tag.'

The solution was this:

RewriteRule /category/(.*) /tag/$1.html [L,R=301] 

Moving away from Blot.Im

Blot.Im is a favorite of mine. It's simple to use and it's making improvements with every update. Still, it's not as feature rich enough for my taste. I'm sure one day it will be. 

Blot uses 'tagged' instead of 'tags' and to solution to that is doing"

RewriteRule /tagged/(.*) /tag/$1.html [L,R=301] 

End Notes

The one thing that I haven't done yet is rewriting changed permalinks. I'm editting my permalinks to remove any stopwords and I would need to update the .htacess file with 100's of them.  The Yoast plugin for Wordpress does this for you if you changed the permalink. That's a wonderful thing and the solution for my problem lies in writing a python script. 

While I ponder how to do that I will say that the simple changes above have already made an impact.


Enable Twitter Cards and Open Graph in Blot.Im

I struggled for days on how to correctly enable Twitter Cards and Open Graph (aka Facebook) in my Blot.IM templates! Days!

The problem is now solved and I will share it here with fellow Blotsters. I have to give a big shouout to David from Blot, I couldn't have solved it without his help!

Why Twitter Cards and Open Graph?

Let's be honest here, not many people create a blog or some sort of content just for it to sit hidden on the Internet. We all crave 'eyeballs' and interaction from others for our awesome content! For that we have to share our missives using mostly Twitter and Facebook. Wordpress and other CMS's make this really easy out of the box via their fancy templates but Blot is a bit different.

Granted it's an emerging awesome CMS and has some great advantages over the Wordpress bloat (see more here), it does require you to roll up your sleeves and do some simple hacking from time to time.

Twitter Cards

I started out by wanting to implement Twitter Cards. If I could that working, then I'd move on to Facebook. As a baseline, I went to the Twitter Card Validator and checked a random blog post. It failed miserably!!! I really wanted to embed an image from the post itself into the Twitter card so I don't get that lame grey icon. I wanted the twitter card to look like below for the this post.

Twitter Card code in your Head file

The neat thing about Blot.Im is that you can hack the HTML files of your theme really easily. You can do it in the native editor Blot provides OR you can do it via importing the templates locally. I work locally because I like working in Sublime Text better than going to the website.

I first opened the head.html file and inspected added a new section called <---Twitter Code--->. Then after much trial and error, and with David's help, figured out the right way hack in the mustache template code.

This works great as long as you have either one image in the body of the blog post. Next step was hacking for Facebook!

Facebook Open Graph

Building on what I learned from above, merging in the Open Graph calls were quite easy.

There was one snag though, you need to get a FB API key to get this work. In the image above you can see where it goes. That's it. Pretty simple if you know what you are doing!


I've Moved

I've moved Neural Market Trends to Blot.IM, a great blogging platfrom that snycs from Dropbox to make posts. Purely html, txt, and markdown format saved into a folder on Dropbox. No more S3 headaches or Ruby crap.

Please bear with me as I fix the broken links and images. Thank you!


Neural Market Trends is the online home of Thomas Ott.